Recently I was working on a project that required an Nginx server to redirect all traffic to
https://domain.com, and by all traffic I mean anything that did not start with
https://domain.com needed to be rewritten to that. This included:
To do this, the configuation file on Nginx should look like this:
Note that you can switch around the settings for the two two 443 blocks and instead force it to write to
www; I’m a fan of excluding it.