Skip to content

Instantly share code, notes, and snippets.

@timscha
Created June 25, 2018 10:03
Show Gist options
  • Save timscha/a791c5453b13a7febd967089c8ccb710 to your computer and use it in GitHub Desktop.
Save timscha/a791c5453b13a7febd967089c8ccb710 to your computer and use it in GitHub Desktop.
Nginx Proxy Config
server {
listen 80;
listen [::]:80;
server_name <server_url>;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name <server_url>;
client_max_body_size 50M;
ssl_certificate /etc/letsencrypt/live/<server_url>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<server_url>/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; ";
location / {
aio threads;
include fastcgi_params;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:<port>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment