Last active
April 22, 2025 10:32
-
-
Save SimonXIX/a89f57b2e3a8434fbc1f5736186c647b to your computer and use it in GitHub Desktop.
Nginx configuration for PubPub Platform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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