top | item 2383342

Useful Rewrites for Nginx

30 points| mshe | 15 years ago |engineyard.com | reply

6 comments

order
[+] BummerCloud|15 years ago|reply
I've found that URL rewrites are one of the primary concerns for those making the switch to Nginx from Apache. This is a great read, especially for SEO-minded folks.
[+] klochner|15 years ago|reply
Anyone know why they're trying to handle https requests on port 80?

   server {
     listen 80;
     server_name bedom.com;
     rewrite ^(.*)$ $scheme://www.bedom.com$1;
   }
[+] krutten7|15 years ago|reply
I've seen many people copy/paste blocks and forget to change the http to https (or vice-versa) so this rewrite is safer as it can go in either block. You spend less time debugging.
[+] marcc|15 years ago|reply
I don't see it. Where does this say https?
[+] marcc|15 years ago|reply
Why would we want to 302 redirect instead of 301 on missing www or mistyped domain names? I'm pretty sure a 301 redirect would be better.