Skip to content

Instantly share code, notes, and snippets.

@napestershine
Last active August 1, 2020 12:10
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 napestershine/feec75bd43a21abad8e879b9e104e81f to your computer and use it in GitHub Desktop.
Save napestershine/feec75bd43a21abad8e879b9e104e81f to your computer and use it in GitHub Desktop.
server {
server_name example.com www.example.com;
root /var/www/html/example;
include conf.d/wp.ini;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) {
return 301 https://www.$host$request_uri;
}
if ($host = codeistalk.com) {
return 301 https://www.$host$request_uri;
} # managed by Certbot
listen 0.0.0.0:80;
server_name codeistalk.com www.codeistalk.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment