mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-24 15:02:31 +00:00
65 lines
1.7 KiB
Nginx Configuration File
65 lines
1.7 KiB
Nginx Configuration File
|
|
server {
|
|
listen 80 default_server;
|
|
server_name _;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
server_name www.pockethost.test;
|
|
return 301 $scheme://pockethost.test$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name pockethost.test;
|
|
ssl_certificate /mount/nginx/ssl/pockethost.test.crt;
|
|
ssl_certificate_key /mount/nginx/ssl/pockethost.test.key;
|
|
access_log /mount/nginx/logs/access.log;
|
|
error_log /mount/nginx/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:5173;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
|
|
server_name *.pockethost.test;
|
|
ssl_certificate /mount/nginx/ssl/pockethost.test.crt;
|
|
ssl_certificate_key /mount/nginx/ssl/pockethost.test.key;
|
|
|
|
access_log /mount/nginx/logs/access.log;
|
|
error_log /mount/nginx/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://daemon:3000;
|
|
}
|
|
}
|