Skip to content

Instantly share code, notes, and snippets.

@dsebastien
Last active October 27, 2024 03:40
Show Gist options
  • Save dsebastien/456829327602ca6a48ac1bbbcb974863 to your computer and use it in GitHub Desktop.
Save dsebastien/456829327602ca6a48ac1bbbcb974863 to your computer and use it in GitHub Desktop.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ws.<YOUR_DOMAIN>;
server_tokens off;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/<YOUR_DOMAIN>/<certificate id>/server.crt;
ssl_certificate_key /etc/nginx/ssl/<YOUR_DOMAIN>/<certificate id>/server.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES25> ssl_prefer_server_ciphers off;
ssl_dhparam /etc/nginx/dhparams.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
charset utf-8;
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/<YOUR DOMAIN>/server/*;
access_log off;
error_log /var/log/nginx/ws.<YOUR DOMAIN>-error.log error;
location / {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://localhost:4201;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment