Skip to content

Instantly share code, notes, and snippets.

@jamesmurdza
Created December 31, 2024 12:31
Show Gist options
  • Save jamesmurdza/1bb30c3b252aa42547e61f52bc8ed03d to your computer and use it in GitHub Desktop.
Save jamesmurdza/1bb30c3b252aa42547e61f52bc8ed03d to your computer and use it in GitHub Desktop.
Nginx SSL proxy for NodeJS
server {
listen 443 ssl;
server_name api.sandbox.gitwit.dev;
ssl_certificate /etc/letsencrypt/live/api.sandbox.gitwit.dev/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/api.sandbox.gitwit.dev/privkey.pem; # managed by Certbot
location / {
proxy_pass http://localhost:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment