mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
85 lines
2.1 KiB
Nginx Configuration File
85 lines
2.1 KiB
Nginx Configuration File
|
|
server {
|
|
listen 80 default_server;
|
|
server_name _;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
|
|
# dev
|
|
server_name www.pockethost.local;
|
|
return 301 $scheme://pockethost.local$request_uri;
|
|
|
|
# prod
|
|
# server_name www.pockethost.io;
|
|
# return 301 $scheme://pockethost.io$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
|
|
# dev
|
|
server_name pockethost.local;
|
|
ssl_certificate /mount/ssl/pockethost.local.crt;
|
|
ssl_certificate_key /mount/ssl/pockethost.local.key;
|
|
|
|
# prod
|
|
# server_name pockethost.io;
|
|
# ssl_certificate /mount/ssl/fullchain.pem;
|
|
# ssl_certificate_key /mount/ssl/privkey.pem;
|
|
|
|
access_log /mount/logs/access.log;
|
|
error_log /mount/logs/error.log;
|
|
|
|
location / {
|
|
proxy_read_timeout 180s;
|
|
|
|
# WebSocket support
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
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_pass http://www:3000;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
|
|
# dev
|
|
server_name *.pockethost.local;
|
|
ssl_certificate /mount/ssl/pockethost.local.crt;
|
|
ssl_certificate_key /mount/ssl/pockethost.local.key;
|
|
|
|
|
|
# prod
|
|
# server_name *.pockethost.io;
|
|
# ssl_certificate /mount/ssl/fullchain.pem;
|
|
# ssl_certificate_key /mount/ssl/privkey.pem;
|
|
|
|
access_log /mount/logs/access.log;
|
|
error_log /mount/logs/error.log;
|
|
|
|
location / {
|
|
proxy_read_timeout 180s;
|
|
|
|
# WebSocket support
|
|
proxy_buffering off; # For realtime
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
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_pass http://pbproxy:3000;
|
|
}
|
|
} |