Skip to content

Instantly share code, notes, and snippets.

@yidas
Last active November 22, 2018 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yidas/ae7b8a6d67f9ab74afd5de88b47c65f1 to your computer and use it in GitHub Desktop.
Save yidas/ae7b8a6d67f9ab74afd5de88b47c65f1 to your computer and use it in GitHub Desktop.
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