6 ms·
Useful Rewrites for Nginx
- BummerCloud 16y agoI'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 16y agoAnyone 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; }
- marcc 16y agoI don't see it. Where does this say https?
- WALoeIII 16y ago$scheme would work with the current request's scheme, so http or https. Its a micro-optimization at best to make it http:// http:// instead.
- krutten7 16y agoI'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 16y agoWhy 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.