Skip to content

Instantly share code, notes, and snippets.

@mutouyuguo
Created May 31, 2019 14:20
Show Gist options
  • Select an option

  • Save mutouyuguo/c20cfbe9f1462b1263aec2f88385a573 to your computer and use it in GitHub Desktop.

Select an option

Save mutouyuguo/c20cfbe9f1462b1263aec2f88385a573 to your computer and use it in GitHub Desktop.
nginx config
server {
listen 443;
server_name codeyuguo.com www.codeyuguo.com;
location / {
root /codeyuguo/www;
index index.html;
try_files $uri $uri/ =404;
}
ssl on;
ssl_certificate /etc/letsencrypt/live/codeyuguo.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/codeyuguo.com/privkey.pem;
}
server {
listen 80;
server_name codeyuguo.com www.codeyuguo.com;
rewrite ^ https://$host$request_uri? permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment