Skip to content

Instantly share code, notes, and snippets.

@weex
Last active July 25, 2021 23:58
Show Gist options
  • Save weex/add4a96da52be1ca32e9698ce713b366 to your computer and use it in GitHub Desktop.
Save weex/add4a96da52be1ca32e9698ce713b366 to your computer and use it in GitHub Desktop.
Working nginx config for trustroots
server {
root /var/www/o3.davidsterry.com/ft;
index index.html index.htm index.nginx-debian.html;
server_name o3.davidsterry.com www.o3.davidsterry.com;
server_tokens off;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
proxy_set_header X-Forwarded-Host o3.davidsterry.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
alias /var/www/o3.davidsterry.com/ft/public/;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/o3.davidsterry.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/o3.davidsterry.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 = o3.davidsterry.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name o3.davidsterry.com www.o3.davidsterry.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment