http { server { listen 80 ssl default_server; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Request-Id $request_id; proxy_set_header X-Forwarded-Proto $scheme; # proxy_next_upstream error timeout http_502; # access_log /dev/stdout; # proxy_connect_timeout 300s; # proxy_read_timeout 300s; # if ($host ~* ^www\.(.*)$) { # set $host_wo_www $1; # rewrite / https://${host_wo_www}$request_uri permanent; # } location / { gzip on; proxy_pass http://localhost:10001; } location /js { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET, HEAD"; root /some/static/root; gzip_proxied any; gzip_static on; access_log off; } } }