Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ngnix 80 to 443 Configuration
server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com; 
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name www.example.com; 
    ssl on;
    ssl_certificate /etc/pki/tls/example.com/fullchain.crt;
    ssl_certificate_key /etc/pki/tls/example.com/server.key;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment