diff --git a/nginx.conf b/nginx.conf index d2061ad..4131bd0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,92 +1,96 @@ worker_processes 1; +# Show startup logs on stderr; switch to debug to print, well, debug logs when +# running nginx-debug +error_log /dev/stderr info; + events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; # Built-in Docker resolver. Needed to allow on-demand resolution of proxy # upstreams. resolver 127.0.0.11 valid=30s; server { listen 5080 default_server; # Add a trailing slash to top level requests (e.g. http://localhost:5080/flower) rewrite ^/([^/]+)$ /$1/ permanent; # In this pile of proxies, all upstreams are set using a variable. This # makes nginx DNS-resolve the name of the upstream when clients request # them, rather than on start. This avoids an unstarted container preventing # nginx from starting. # # Variables need to be set as early as possible, as they're statements from # the rewrite module and `rewrite [...] break;` will prevent these # statements from being executed. location /flower/ { set $upstream "http://flower:5555"; rewrite ^/flower/(.*)$ /$1 break; proxy_pass $upstream; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /rabbitmq/ { set $upstream "http://amqp:15672"; rewrite ^/rabbitmq/(.*)$ /$1 break; proxy_pass $upstream; } location /scheduler { set $upstream "http://swh-scheduler-api:5008"; rewrite ^/scheduler/(.*)$ /$1 break; proxy_pass $upstream; } location /storage { set $upstream "http://swh-storage:5002"; rewrite ^/storage/(.*)$ /$1 break; proxy_pass $upstream; } location /indexer-storage { set $upstream "http://swh-idx-storage:5007"; rewrite ^/indexer-storage/(.*)$ /$1 break; proxy_pass $upstream; } location /deposit { set $upstream "http://swh-deposit:5006"; rewrite ^/deposit/(.*)$ /$1 break; proxy_pass $upstream; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_redirect off; } location /objstorage { set $upstream "http://swh-objstorage:5003"; rewrite ^/objstorage/(.*)$ /$1 break; proxy_pass $upstream; } location / { set $upstream "http://swh-web:5004"; proxy_pass $upstream; } } }