Jul 29, 2017

How to Force HTTP To HTTPS In NGINX

If you're running on Nginx then you can add the following to your site config this listens for any requests coming to your site on port 80 with is HTTP, then will redirect the user to the request page on HTTPS.

server
{
        listen 80;
        server_name paulund.co.uk www.paulund.co.uk;
        rewrite ^/(.*) https://paulund.co.uk/$1 permanent;
}