Skip to content

Instantly share code, notes, and snippets.

@ayxos
Last active November 14, 2019 13:53
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 ayxos/0a1639ce31f307a76a4a3bbc3f653961 to your computer and use it in GitHub Desktop.
Save ayxos/0a1639ce31f307a76a4a3bbc3f653961 to your computer and use it in GitHub Desktop.
nginx node proxy
server {
server_name test.com;
gzip on;
gzip_types application/javascript image/* text/css;
gunzip on;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 /;
listen 443 http2 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/test.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/test.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 {
listen 80;
server_name test.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