pandora-alpine/docker/etc/nginx/nginx.conf
2018-01-18 09:42:00 +01:00

82 lines
1.7 KiB
Nginx Configuration File

user nginx;
pid /run/nginx.pid;
worker_processes 1;
error_log /dev/stderr warn;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log off;
server_tokens off;
keepalive_timeout 65;
sendfile on;
tcp_nodelay on;
server {
listen 80;
server_name localhost;
location /favicon.ico {
root /srv/pandora/static;
}
location /static/ {
root /srv/pandora;
autoindex off;
}
location /data/ {
internal;
root /srv/pandora;
}
location /api/ws/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Proxy "";
proxy_redirect off;
proxy_buffering off;
proxy_read_timeout 999999999;
proxy_pass http://127.0.0.1:2622/;
}
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $http_host;
proxy_set_header Proxy "";
proxy_redirect off;
proxy_buffering off;
proxy_read_timeout 90; #should be in sync with gunicorn timeout
proxy_connect_timeout 90; #should be in sync with gunicorn timeout
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:2620;
break;
}
client_max_body_size 32m;
}
error_page 400 /;
error_page 403 /403.html;
location /403.html {
root /srv/pandora/static/html;
}
error_page 404 /404.html;
location /404.html {
root /srv/pandora/static/html;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location /50x.html {
root /srv/pandora/static/html;
}
}
}