user nginx lilia; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } 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"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip on; server { listen 80; server_name localhost; location / { root /app; index index.php; try_files $uri $uri/ /index.php?$query_string; } location ~ ^/.+\.php$ { root /app; index index.php; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; fastcgi_pass cms:9000; } location ^~ /gifted-subs/assets/ { root /gifted-subs; } location ^~ /quotes/assets/ { root /quotes; } location ^~ /schedule/assets/ { root /schedule; } location ^~ /twitch-logs/assets/ { root /twitch-logs; } location ^~ /gifted-subs/api/ { rewrite ^/gifted-subs/api(/.*)$ $1 break; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; tcp_nodelay on; proxy_pass http://gifted-subs-api:5000/; } location ^~ /quotes/api/ { rewrite ^/quotes/api(/.*)$ $1 break; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; tcp_nodelay on; proxy_pass http://quotes-api:5000/; } location ^~ /twitch-cache/api/ { rewrite ^/twitch-cache/api(/.*)$ $1 break; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; tcp_nodelay on; proxy_pass http://twitch-cache-api:5000/; } location ~ /\.ht { deny all; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } }