Nginx 1 · Reverse proxy and TLS

Redirect HTTP to HTTPS

Send every plain HTTP request to the HTTPS version of the same URL.

server {
    listen 80;
    server_name example.com;
    return 301 https://$host$request_uri;
}

Official Nginx 1 documentation

More reverse proxy and tls commands

All reverse proxy and tls commands · Nginx 1 cheatsheet

Was this page helpful?