Nginx – Redirect a specific url

A client wants the old .aspx path could redirect the visitor to another URL. I don’t want to make the server to host a .aspx file so i add the redirection in the Nginx virtual host config.

Add the following lines insider the server { … }.

## Special redirect for the following
## old xxx.aspx to
location /xxx.aspx {
  return 301 $scheme://;


Done =)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.