Redirect traffic from HTTP to HTTPS Using Nginx- 1 min
Let’s redirect all
http traffic to
https thus making all traffic more secure while getting a little extra love from Google.
Updated your configuration file
Add this to our current configuration file or make a new one.
Always test your configuration
ALWAYS check your configuration before reloading nginx. ALWAYS!
For such settings to take effect you will have to reload Nginx again with the command:
Check the redirect is working as expected
We can use
curl -I url-to-test to do this quickly and easily.
And we should see something like this: