|
|
|
@ -2,10 +2,11 @@ user nginx; |
|
|
|
error_log /var/log/nginx/error.log warn; |
|
|
|
pid /var/run/nginx.pid; |
|
|
|
worker_processes auto; |
|
|
|
worker_rlimit_nofile 33282; |
|
|
|
# worker_rlimit_nofile 33282; |
|
|
|
# sendfile_max_chunk 512k; |
|
|
|
|
|
|
|
events { |
|
|
|
worker_connections 4096; |
|
|
|
worker_connections 1024; |
|
|
|
} |
|
|
|
|
|
|
|
http { |
|
|
|
@ -15,15 +16,14 @@ http { |
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
|
|
|
'$status $body_bytes_sent "$http_referer" ' |
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"'; |
|
|
|
|
|
|
|
|
|
|
|
map $http_upgrade $connection_upgrade { |
|
|
|
default "upgrade"; |
|
|
|
} |
|
|
|
|
|
|
|
server { |
|
|
|
listen 0.0.0.0:10000 default_server; |
|
|
|
listen 10000 default_server; |
|
|
|
server_name _; |
|
|
|
resolver 127.0.0.11 valid=10s; |
|
|
|
|
|
|
|
# security headers |
|
|
|
add_header X-Frame-Options SAMEORIGIN always; |
|
|
|
@ -34,58 +34,61 @@ http { |
|
|
|
proxy_set_header X-Forwarded-Proto $scheme; |
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
|
|
|
|
|
|
|
|
|
|
# budibase services |
|
|
|
set $app_service http://{{ address }}:4001; |
|
|
|
set $worker_service http://{{ address }}:4002; |
|
|
|
set $builder http://{{ address }}:3000; |
|
|
|
set $minio http://minio-service:9000; |
|
|
|
set $couchdb http://couchdb-service:5984; |
|
|
|
# set $app_service http://{{ address }}:4001; |
|
|
|
# set $worker_service http://{{ address }}:4002; |
|
|
|
# set $builder http://{{ address }}:3000; |
|
|
|
# set $minio http://minio-service:9000; |
|
|
|
# set $couchdb http://couchdb-service:5984; |
|
|
|
|
|
|
|
# config options |
|
|
|
client_header_timeout 60; |
|
|
|
client_body_timeout 60; |
|
|
|
keepalive_timeout 60; |
|
|
|
gzip off; |
|
|
|
gzip_comp_level 4; |
|
|
|
|
|
|
|
|
|
|
|
location = / { |
|
|
|
return 301 /builder/; |
|
|
|
} |
|
|
|
|
|
|
|
location /db/ { |
|
|
|
proxy_pass $couchdb; |
|
|
|
proxy_pass http://couchdb-service:5984; |
|
|
|
rewrite ^/db/(.*)$ /$1 break; |
|
|
|
} |
|
|
|
|
|
|
|
location ~ ^/(global|admin|system)/ { |
|
|
|
proxy_pass $worker_service; |
|
|
|
location ~ ^/api/(system|admin|global)/ { |
|
|
|
proxy_pass http://{{ address }}:4002; |
|
|
|
} |
|
|
|
|
|
|
|
location /api/ { |
|
|
|
proxy_read_timeout 120s; |
|
|
|
proxy_connect_timeout 120s; |
|
|
|
proxy_send_timeout 120s; |
|
|
|
proxy_pass $app_service; |
|
|
|
proxy_pass http://{{ address }}:4001; |
|
|
|
} |
|
|
|
|
|
|
|
location ^/(app_|builder) { |
|
|
|
proxy_pass $app_service; |
|
|
|
location /app_ { |
|
|
|
proxy_pass http://{{ address }}:4001; |
|
|
|
} |
|
|
|
|
|
|
|
location /app/ { |
|
|
|
proxy_pass $app_service; |
|
|
|
rewrite ^/app/(.*)$ /$1 break; |
|
|
|
proxy_pass http://{{ address }}:4001; |
|
|
|
rewrite ^/app/(.*)$ $1 break; |
|
|
|
} |
|
|
|
|
|
|
|
{{!-- location = / { |
|
|
|
proxy_pass $builder; |
|
|
|
} --}} |
|
|
|
|
|
|
|
location /builder { |
|
|
|
proxy_pass $builder; |
|
|
|
proxy_pass http://{{ address }}:3000; |
|
|
|
rewrite ^/builder(.*)$ /builder/$1 break; |
|
|
|
} |
|
|
|
|
|
|
|
location /builder/ { |
|
|
|
proxy_pass $builder; |
|
|
|
proxy_pass http://{{ address }}:3000; |
|
|
|
} |
|
|
|
|
|
|
|
location / { |
|
|
|
proxy_pass $minio; |
|
|
|
proxy_pass http://minio-service:9000; |
|
|
|
} |
|
|
|
} |
|
|
|
} |