Files
baserow/docs/installation/configuration-files/nginx.conf

99 lines
2.8 KiB
Nginx Configuration File

# Backend
server {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
gzip_disable "msie6";
listen 80;
server_name "*YOUR_BACKEND_DOMAIN*";
proxy_read_timeout 1800s;
client_max_body_size 0; # avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
chunked_transfer_encoding on;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
# Web frontend
server {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
gzip_disable "msie6";
listen 80;
server_name "*YOUR_WEB_FRONTEND_DOMAIN*";
proxy_read_timeout 1800s;
client_max_body_size 0; # avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
chunked_transfer_encoding on;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_pass_request_headers on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# Media
map $arg_dl $baserow_media_content_disposition {
default "attachment; filename=$arg_dl";
"" "";
}
server {
listen 80;
server_name "*YOUR_MEDIA_DOMAIN*";
autoindex off;
gzip on;
gzip_disable "msie6";
location / {
add_header Content-Disposition $baserow_media_content_disposition always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "sandbox; default-src 'none'; script-src 'none'; object-src 'none'; base-uri 'none'" always;
root /baserow/media;
}
location /user_files {
add_header Content-Disposition $baserow_media_content_disposition always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "sandbox; default-src 'none'; script-src 'none'; object-src 'none'; base-uri 'none'" always;
root /baserow/media;
}
location /export_files {
add_header Content-Disposition $baserow_media_content_disposition always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "sandbox; default-src 'none'; script-src 'none'; object-src 'none'; base-uri 'none'" always;
root /baserow/media;
}
}