Skip to content

Instantly share code, notes, and snippets.

@gslin
Last active June 1, 2023 12:35
Show Gist options
  • Save gslin/8399a752ba845b099b5141343a6dbc25 to your computer and use it in GitHub Desktop.
Save gslin/8399a752ba845b099b5141343a6dbc25 to your computer and use it in GitHub Desktop.
#
server {
listen 80;
listen [::]:80;
server_name test3.gslin.com;
root /srv/test3.gslin.com/public;
index index.html;
access_log /var/log/nginx/test3.gslin.com-access.log combined;
return 301 https://$server_name$request_uri;
}
server {
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name test3.gslin.com;
ssl_certificate /etc/dehydrated/certs/test3.gslin.com/fullchain.pem;
ssl_certificate_key /etc/dehydrated/certs/test3.gslin.com/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/dehydrated/certs/test3.gslin.com/fullchain.pem;
add_header Strict-Transport-Security "max-age=31536000";
root /srv/test3.gslin.com/public;
index index.html;
access_log /var/log/nginx/test3.gslin.com_ssl-access.log combined_ssl;
location /.well-known/acme-challenge/ {
alias /var/www/dehydrated/;
}
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment