events { worker_connections 1024; # Adjust this to your needs } http { proxy_cache_path /tmp/nginx_ajax_proxy_cache levels=1:2 keys_zone=ajax_proxy:10m inactive=60m; proxy_cache_key "$uri$is_args$args"; map $http_upgrade $connection_upgrade { default upgrade; '' close; } types { application/javascript mjs; } include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; # Server block server { listen 80; server_name localhost; include "/etc/nginx/snippets/umap.conf"; # Proxy pass to ASGI server location / { proxy_pass http://{{ env "STACK_NAME" }}-app:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_redirect off; proxy_buffering off; } access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log warn; } }