budibase/hosting/nginx.dev.conf.hbs

94 lines
2.3 KiB
Handlebars
Raw Normal View History

2022-01-11 20:33:22 +01:00
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
2022-01-13 14:27:02 +01:00
# worker_rlimit_nofile 33282;
# sendfile_max_chunk 512k;
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;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
2022-01-13 14:27:02 +01:00
2022-01-11 20:33:22 +01:00
map $http_upgrade $connection_upgrade {
default "upgrade";
}
server {
2022-01-13 14:27:02 +01:00
listen 10000 default_server;
2022-01-11 20:33:22 +01:00
server_name _;
# security headers
add_header X-Frame-Options SAMEORIGIN always;
# proxy headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# budibase services
2022-01-13 14:27:02 +01:00
# 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;
2022-01-11 20:33:22 +01:00
location = / {
return 301 /builder/;
}
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)/ {
proxy_pass http://{{ address }}:4002;
2022-01-11 20:33:22 +01:00
}
location /api/ {
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
2022-01-13 14:27:02 +01:00
proxy_pass http://{{ address }}:4001;
2022-01-11 20:33:22 +01:00
}
2022-01-13 14:27:02 +01:00
location /app_ {
proxy_pass http://{{ address }}:4001;
2022-01-11 20:33:22 +01:00
}
location /app/ {
2022-01-13 14:27:02 +01:00
proxy_pass http://{{ address }}:4001;
rewrite ^/app/(.*)$ $1 break;
2022-01-11 20:33:22 +01:00
}
location /builder {
2022-01-13 14:27:02 +01:00
proxy_pass http://{{ address }}:3000;
2022-01-11 20:33:22 +01:00
rewrite ^/builder(.*)$ /builder/$1 break;
}
location /builder/ {
2022-01-13 14:27:02 +01:00
proxy_pass http://{{ address }}:3000;
2022-01-11 20:33:22 +01:00
}
location / {
2022-01-13 14:27:02 +01:00
proxy_pass http://minio-service:9000;
2022-01-11 20:33:22 +01:00
}
}
}