Files
Termix/docker/nginx.conf
T

451 lines
17 KiB
Nginx Configuration File
Raw Normal View History

2026-01-24 19:49:42 -06:00
worker_processes 1;
master_process off;
2026-05-06 15:12:07 -05:00
pid /tmp/nginx/nginx.pid;
error_log /tmp/nginx/error.log warn;
+1
2025-12-31 22:20:12 -06:00
2025-08-07 02:20:27 -05:00
events {
worker_connections 1024;
}
http {
+1
2025-12-31 22:20:12 -06:00
include /etc/nginx/mime.types;
2025-08-07 02:20:27 -05:00
default_type application/octet-stream;
+3
2026-08-06 14:41:39 -05:00
server_tokens off;
2026-05-06 15:12:07 -05:00
access_log /tmp/nginx/access.log;
+1
2025-12-31 22:20:12 -06:00
2026-05-06 15:12:07 -05:00
client_body_temp_path /tmp/nginx/client_body;
proxy_temp_path /tmp/nginx/proxy_temp;
fastcgi_temp_path /tmp/nginx/fastcgi_temp;
uwsgi_temp_path /tmp/nginx/uwsgi_temp;
scgi_temp_path /tmp/nginx/scgi_temp;
+1
2025-12-31 22:20:12 -06:00
2025-08-07 02:20:27 -05:00
sendfile on;
keepalive_timeout 65;
+5
2026-08-19 14:12:06 -05:00
# Static assets only. API responses arrive already gzipped from the node
# backend, and gzip_proxied would otherwise have nginx decompress and
# recompress them for nothing.
gzip on;
gzip_vary on;
gzip_min_length 2048;
gzip_comp_level 5;
gzip_types
text/plain
text/css
text/javascript
application/javascript
application/json
application/wasm
image/svg+xml;
2025-10-01 15:40:10 -05:00
client_header_timeout 300s;
2026-10-10 14:58:27 -05:00
# BEGIN TRUSTED_PROXIES
2025-10-06 10:11:25 -05:00
set_real_ip_from 127.0.0.1;
2026-06-21 15:55:41 -05:00
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
2026-10-10 14:58:27 -05:00
# END TRUSTED_PROXIES
2025-10-06 10:11:25 -05:00
real_ip_header X-Forwarded-For;
2026-06-21 15:55:41 -05:00
real_ip_recursive on;
2025-10-06 10:11:25 -05:00
+5
2026-03-08 18:02:14 -05:00
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
default $http_x_forwarded_host;
'' $http_host;
}
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' '';
+5
2026-03-08 18:02:14 -05:00
}
2025-10-01 15:40:10 -05:00
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
2025-08-07 02:20:27 -05:00
server {
listen ${PORT};
2026-06-04 15:16:53 -04:00
server_name _;
+5
2026-08-19 14:12:06 -05:00
client_max_body_size 50m;
2025-08-07 02:20:27 -05:00
+2
2026-06-16 15:59:53 -05:00
absolute_redirect off;
2025-10-01 15:40:10 -05:00
add_header X-Content-Type-Options nosniff always;
2026-06-21 15:55:41 -05:00
location ^~ /.well-known/acme-challenge/ {
2026-10-01 16:20:16 -05:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
}
2026-05-06 15:12:07 -05:00
location = /sw.js {
root /app/html;
expires off;
+3
2026-08-06 14:41:39 -05:00
add_header X-Content-Type-Options nosniff always;
2026-05-06 15:12:07 -05:00
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
try_files $uri =404;
}
location = /manifest.json {
root /app/html;
expires off;
+3
2026-08-06 14:41:39 -05:00
add_header X-Content-Type-Options nosniff always;
2026-05-06 15:12:07 -05:00
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
try_files $uri =404;
}
+3
2026-08-06 14:41:39 -05:00
location ^~ /assets/ {
+1
2025-12-31 22:20:12 -06:00
root /app/html;
+7
2025-11-05 10:36:16 -06:00
expires 1y;
+3
2026-08-06 14:41:39 -05:00
add_header X-Content-Type-Options nosniff always;
2026-05-06 15:12:07 -05:00
add_header Cache-Control "public, max-age=31536000, immutable" always;
+7
2025-11-05 10:36:16 -06:00
try_files $uri =404;
}
+3
2026-08-06 14:41:39 -05:00
location ^~ /fonts/ {
root /app/html;
expires 1y;
add_header X-Content-Type-Options nosniff always;
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
location ^~ /icons/ {
root /app/html;
expires 30d;
add_header X-Content-Type-Options nosniff always;
add_header Cache-Control "public, max-age=2592000" always;
try_files $uri =404;
}
location ~* ^/[^/]+\.(js|css|png|jpe?g|gif|ico|svg|webp|woff2?|ttf|eot)$ {
root /app/html;
expires 30d;
add_header X-Content-Type-Options nosniff always;
add_header Cache-Control "public, max-age=2592000" always;
try_files $uri =404;
}
location ~* \.map$ {
access_log off;
log_not_found off;
return 404;
}
2025-08-07 02:20:27 -05:00
location / {
+1
2025-12-31 22:20:12 -06:00
root /app/html;
2025-08-07 02:20:27 -05:00
index index.html index.htm;
2026-05-06 15:12:07 -05:00
expires off;
2026-10-10 14:58:27 -05:00
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-0FPou4vGHwupDie6Xais6VntpJ4yaK9E6TyhXLwZe8o='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; media-src 'self' data: blob: http: https:; worker-src 'self' blob:; frame-src http: https:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
+17
2026-09-20 14:56:39 -05:00
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
+3
2026-08-06 14:41:39 -05:00
add_header X-Content-Type-Options nosniff always;
2026-05-06 15:12:07 -05:00
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
+7
2025-11-05 10:36:16 -06:00
try_files $uri $uri/ /index.html;
2025-08-07 02:20:27 -05:00
}
+7
2025-11-05 10:36:16 -06:00
location ~ ^/users/sessions(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
+7
2025-11-05 10:36:16 -06:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+5
2026-03-08 18:02:14 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
+7
2025-11-05 10:36:16 -06:00
}
2025-09-12 14:42:00 -05:00
location ~ ^/users(/.*)?$ {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
2025-08-07 02:20:27 -05:00
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-08-07 02:20:27 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+5
2026-03-08 18:02:14 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host;
2025-08-07 02:20:27 -05:00
}
2025-09-12 14:42:00 -05:00
location ~ ^/version(/.*)?$ {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
2025-08-08 01:20:58 -05:00
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-08-08 01:20:58 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2025-08-08 01:20:58 -05:00
}
2025-09-12 14:42:00 -05:00
location ~ ^/releases(/.*)?$ {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
2025-08-08 01:20:58 -05:00
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-08-08 01:20:58 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2025-08-08 01:20:58 -05:00
}
+1
2025-12-31 22:20:12 -06:00
location ~ ^/rbac(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
+1
2025-12-31 22:20:12 -06:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
+1
2025-12-31 22:20:12 -06:00
}
2025-09-12 14:42:00 -05:00
location ~ ^/credentials(/.*)?$ {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-10-01 15:40:10 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
+7
2025-11-05 10:36:16 -06:00
2025-10-01 15:40:10 -05:00
proxy_connect_timeout 60s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
2026-10-01 16:20:16 -05:00
location ~ ^/ssh-auth(/.*)?$ {
2026-06-29 13:28:26 -05:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
+2
2026-07-26 18:47:27 -05:00
location ~ ^/sync(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
+2
2026-06-16 15:59:53 -05:00
location ~ ^/audit-logs(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
+2
2026-06-16 15:59:53 -05:00
}
2026-10-01 16:20:16 -05:00
location ~ ^/plugins(/.*)?$ {
2025-11-17 09:46:05 -06:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-11-17 09:46:05 -06:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2025-11-17 09:46:05 -06:00
}
2026-10-01 16:20:16 -05:00
# Plugin frontend bundles, stylesheets and locales. Public like
# /assets; the backend picks the cache policy from the ?v= query.
location ^~ /plugin-assets/ {
+17
2026-09-20 14:56:39 -05:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
2026-10-01 16:20:16 -05:00
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
# Every plugin's HTTP routes. One block, no per-plugin entries: a
# plugin serves at /plugin-api/<id>/ on the main backend and never
# gets a port or a block of its own. Buffering is off so SSE streams
# (AI, Proxmox discovery) reach the browser as they are produced, and
# request buffering is off so large uploads stream through.
location ^~ /plugin-api/ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_connect_timeout 10s;
proxy_buffering off;
proxy_request_buffering off;
client_max_body_size 0;
}
# Every plugin's WebSockets: terminal, Guacamole display, Docker
# console. Served at /plugin-ws/<id>/<path> from the same backend.
location ^~ /plugin-ws/ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
+17
2026-09-20 14:56:39 -05:00
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
2026-10-01 16:20:16 -05:00
proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
+17
2026-09-20 14:56:39 -05:00
proxy_cache_bypass $http_upgrade;
2026-10-01 16:20:16 -05:00
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_connect_timeout 10s;
proxy_buffering off;
proxy_request_buffering off;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
+17
2026-09-20 14:56:39 -05:00
}
2026-05-28 22:05:25 -04:00
location ~ ^/open-tabs(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2026-05-28 22:05:25 -04:00
}
location ~ ^/user-preferences(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2026-05-28 22:05:25 -04:00
}
+5
2026-08-19 14:12:06 -05:00
location ~ ^/host-sidebar(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
location ~ ^/credential-sidebar(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
location ~ ^/ui-preferences(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $proxy_x_forwarded_proto;
}
+7
2025-11-05 10:36:16 -06:00
location ~ ^/database(/.*)?$ {
client_max_body_size 5G;
client_body_timeout 300s;
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
+7
2025-11-05 10:36:16 -06:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
+7
2025-11-05 10:36:16 -06:00
2025-10-01 15:40:10 -05:00
proxy_connect_timeout 60s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
+7
2025-11-05 10:36:16 -06:00
2025-10-01 15:40:10 -05:00
proxy_request_buffering off;
proxy_buffering off;
}
location ~ ^/encryption(/.*)?$ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
}
2026-03-14 20:05:05 -05:00
location /host/quick-connect {
2026-01-24 19:49:42 -06:00
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $http_host;
2026-01-24 19:49:42 -06:00
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2026-10-12 11:35:48 -05:00
# A terminal is quiet most of the time - waiting on a prompt, reading
# output, running something long. Every console plugin dials this route
# (terminal, serial, remote desktop), and nginx's default
# proxy_read_timeout of 60s closed the socket about a minute into any
# pause, which reaches the user as the SSH server disconnecting. The
# plugin WebSocket routes below already ask for 86400s; this is the same
# class of socket, so it asks for the same.
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_buffering off;
2026-01-24 19:49:42 -06:00
}
2026-03-14 20:05:05 -05:00
location /host/ {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
2025-08-12 14:38:01 -05:00
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-08-12 14:38:01 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2025-08-12 14:38:01 -05:00
}
2026-10-01 16:20:16 -05:00
# File manager routes (recent/pinned/shortcuts, SFTP, transfers) moved
# to the file-manager plugin, served under /plugin-api/file-manager/.
# Session logs moved to the session-recording plugin, served under
# /plugin-api/session-recording/.
2026-01-24 19:49:42 -06:00
2025-09-12 14:42:00 -05:00
location /health {
2025-10-01 15:40:10 -05:00
proxy_pass http://127.0.0.1:30001;
2025-09-12 14:42:00 -05:00
proxy_http_version 1.1;
proxy_set_header Host $http_host;
2025-09-12 14:42:00 -05:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
2025-09-12 14:42:00 -05:00
}
2026-10-01 16:20:16 -05:00
# Service links and the homepage widget canvas moved to the homepage
# plugin, served under /plugin-api/homepage/.
location /dashboard/ {
proxy_pass http://127.0.0.1:30001;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2026-06-21 15:55:41 -05:00
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
}
2025-08-07 02:20:27 -05:00
error_page 500 502 503 504 /50x.html;
location = /50x.html {
+1
2025-12-31 22:20:12 -06:00
root /app/html;
+3
2026-08-06 14:41:39 -05:00
internal;
2025-08-07 02:20:27 -05:00
}
}
+7
2025-11-05 10:36:16 -06:00
}