2022-01-11 20:33:22 +01:00
|
|
|
user nginx;
|
2022-01-14 14:44:40 +01:00
|
|
|
error_log /var/log/nginx/error.log debug;
|
2022-01-11 20:33:22 +01:00
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
worker_processes auto;
|
2022-01-14 14:44:40 +01:00
|
|
|
worker_rlimit_nofile 33282;
|
2022-01-11 20:33:22 +01:00
|
|
|
|
|
|
|
events {
|
2022-01-13 14:27:02 +01:00
|
|
|
worker_connections 1024;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
2022-02-21 11:46:45 +01:00
|
|
|
proxy_set_header Host $host;
|
2022-01-11 20:33:22 +01:00
|
|
|
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
2022-08-26 14:18:38 +02:00
|
|
|
'"$http_user_agent" "$http_x_forwarded_for" '
|
|
|
|
'response_time=$upstream_response_time proxy_host=$proxy_host upstream_addr=$upstream_addr';
|
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log main;
|
2022-01-13 14:27:02 +01:00
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default "upgrade";
|
|
|
|
}
|
|
|
|
|
2022-10-13 12:26:25 +02:00
|
|
|
upstream app-service {
|
2022-12-20 17:28:13 +01:00
|
|
|
server ${PROXY_ADDRESS}:4001;
|
2022-10-13 12:26:25 +02:00
|
|
|
keepalive 32;
|
|
|
|
}
|
|
|
|
|
|
|
|
upstream worker-service {
|
2022-12-20 17:28:13 +01:00
|
|
|
server ${PROXY_ADDRESS}:4002;
|
2022-10-13 12:26:25 +02:00
|
|
|
keepalive 32;
|
|
|
|
}
|
|
|
|
|
|
|
|
upstream builder {
|
2022-12-20 17:28:13 +01:00
|
|
|
server ${PROXY_ADDRESS}:3000;
|
2022-10-13 12:26:25 +02:00
|
|
|
keepalive 32;
|
|
|
|
}
|
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
server {
|
2022-01-13 14:27:02 +01:00
|
|
|
listen 10000 default_server;
|
2022-01-11 20:33:22 +01:00
|
|
|
server_name _;
|
2023-12-06 13:49:49 +01:00
|
|
|
client_max_body_size 50000m;
|
2022-01-30 21:11:59 +01:00
|
|
|
ignore_invalid_headers off;
|
|
|
|
proxy_buffering off;
|
2022-01-11 20:33:22 +01:00
|
|
|
|
2022-03-31 16:58:45 +02:00
|
|
|
error_page 502 503 504 /error.html;
|
|
|
|
location = /error.html {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
internal;
|
|
|
|
}
|
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
location /db/ {
|
2022-01-13 14:27:02 +01:00
|
|
|
proxy_pass http://couchdb-service:5984;
|
2022-01-11 20:33:22 +01:00
|
|
|
rewrite ^/db/(.*)$ /$1 break;
|
|
|
|
}
|
|
|
|
|
2022-01-13 14:27:02 +01:00
|
|
|
location ~ ^/api/(system|admin|global)/ {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://worker-service;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
2022-11-09 12:33:57 +01:00
|
|
|
location /api/backups/ {
|
|
|
|
proxy_read_timeout 1800s;
|
|
|
|
proxy_connect_timeout 1800s;
|
|
|
|
proxy_send_timeout 1800s;
|
|
|
|
proxy_pass http://app-service;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Connection "";
|
|
|
|
}
|
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
location /api/ {
|
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
2022-11-09 17:35:16 +01:00
|
|
|
proxy_send_timeout 120s;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://app-service;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
2022-02-18 12:18:59 +01:00
|
|
|
location = / {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://app-service;
|
2022-02-18 12:18:59 +01:00
|
|
|
}
|
|
|
|
|
2022-01-13 14:27:02 +01:00
|
|
|
location /app_ {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://app-service;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 17:45:06 +01:00
|
|
|
location /app {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://app-service;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
2023-06-16 13:30:08 +02:00
|
|
|
location /embed {
|
|
|
|
rewrite /embed/(.*) /app/$1 break;
|
|
|
|
proxy_pass http://app-service;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header x-budibase-embed "true";
|
|
|
|
add_header x-budibase-embed "true";
|
|
|
|
add_header Content-Security-Policy "frame-ancestors *";
|
|
|
|
}
|
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
location /builder {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_set_header Connection "";
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://builder;
|
2022-01-11 20:33:22 +01:00
|
|
|
rewrite ^/builder(.*)$ /builder/$1 break;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /builder/ {
|
2022-01-14 14:44:40 +01:00
|
|
|
proxy_http_version 1.1;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
2022-01-14 14:44:40 +01:00
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
2022-11-09 17:35:16 +01:00
|
|
|
|
|
|
|
proxy_pass http://builder;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
|
|
|
|
2022-08-19 12:09:20 +02:00
|
|
|
location /vite/ {
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_pass http://builder;
|
|
|
|
proxy_read_timeout 120s;
|
|
|
|
proxy_connect_timeout 120s;
|
|
|
|
proxy_send_timeout 120s;
|
2022-08-19 12:09:20 +02:00
|
|
|
rewrite ^/vite(.*)$ /$1 break;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /socket/ {
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection 'upgrade';
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_cache_bypass $http_upgrade;
|
2022-10-13 12:26:25 +02:00
|
|
|
proxy_pass http://app-service;
|
2022-08-16 11:25:16 +02:00
|
|
|
}
|
|
|
|
|
2022-01-11 20:33:22 +01:00
|
|
|
location / {
|
2022-01-30 21:11:59 +01:00
|
|
|
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;
|
2022-02-25 16:54:39 +01:00
|
|
|
proxy_set_header Host $http_host;
|
2022-01-30 21:11:59 +01:00
|
|
|
|
|
|
|
proxy_connect_timeout 300;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Connection "";
|
|
|
|
chunked_transfer_encoding off;
|
|
|
|
|
2022-01-13 14:27:02 +01:00
|
|
|
proxy_pass http://minio-service:9000;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
2022-01-14 14:44:40 +01:00
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
location /files/signed/ {
|
|
|
|
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;
|
|
|
|
|
|
|
|
# IMPORTANT: Signed urls will inspect the host header of the request.
|
|
|
|
# Normally a signed url will need to be generated with a specified client host in mind.
|
|
|
|
# To support dynamic hosts, e.g. some unknown self-hosted installation url,
|
|
|
|
# use a predefined host header. The host 'minio-service' is also used at the time of url signing.
|
|
|
|
proxy_set_header Host minio-service;
|
|
|
|
|
|
|
|
proxy_connect_timeout 300;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Connection "";
|
|
|
|
chunked_transfer_encoding off;
|
|
|
|
|
|
|
|
proxy_pass http://minio-service:9000;
|
|
|
|
rewrite ^/files/signed/(.*)$ /$1 break;
|
|
|
|
}
|
|
|
|
|
2022-01-14 14:44:40 +01:00
|
|
|
client_header_timeout 60;
|
|
|
|
client_body_timeout 60;
|
|
|
|
keepalive_timeout 60;
|
|
|
|
gzip off;
|
|
|
|
gzip_comp_level 4;
|
2022-01-11 20:33:22 +01:00
|
|
|
}
|
2022-02-25 16:54:39 +01:00
|
|
|
}
|