77 lines
2.4 KiB
Plaintext
77 lines
2.4 KiB
Plaintext
# Dev docker-compose only: local `npm run dev` uses port 3001 (see frontend package.json).
|
|
# Staging / registry stacks use http-only.conf (frontend:3000).
|
|
|
|
upstream dyolink_backend {
|
|
server backend:3000;
|
|
keepalive 32;
|
|
}
|
|
|
|
upstream dyolink_frontend {
|
|
server frontend:3001;
|
|
keepalive 32;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name _;
|
|
|
|
client_max_body_size 50M;
|
|
|
|
location / {
|
|
proxy_pass http://dyolink_frontend;
|
|
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_cache_bypass $http_upgrade;
|
|
proxy_read_timeout 300;
|
|
proxy_connect_timeout 300;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://dyolink_backend;
|
|
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_cache_bypass $http_upgrade;
|
|
# Attachments have no size cap. Stream the body so a large scan is not
|
|
# rejected or dropped when the client pauses.
|
|
client_max_body_size 0;
|
|
client_body_timeout 3600s;
|
|
send_timeout 3600s;
|
|
proxy_request_buffering off;
|
|
proxy_read_timeout 3600s;
|
|
proxy_send_timeout 3600s;
|
|
proxy_connect_timeout 300;
|
|
}
|
|
|
|
# AdminJS (Nest, not under /api)
|
|
location /admin {
|
|
proxy_pass http://dyolink_backend;
|
|
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_cache_bypass $http_upgrade;
|
|
proxy_read_timeout 300;
|
|
proxy_connect_timeout 300;
|
|
}
|
|
|
|
location /health {
|
|
access_log off;
|
|
return 200 "healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
}
|