Skip to content

Instantly share code, notes, and snippets.

@SimonXIX
Last active April 22, 2025 10:32
Show Gist options
  • Save SimonXIX/a89f57b2e3a8434fbc1f5736186c647b to your computer and use it in GitHub Desktop.
Save SimonXIX/a89f57b2e3a8434fbc1f5736186c647b to your computer and use it in GitHub Desktop.
Nginx configuration for PubPub Platform
upstream platform {
server self-host-platform-1:3000;
}
server {
listen 80;
server_name platform.DOMAIN;
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /PATH/TO/CERTIFICATE.crt;
ssl_certificate_key /PATH/TO/KEY.key;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
location / {
proxy_pass http://platform;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment