#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { # CORS support add_header Access-Control-Allow-Origin *; # Handling preflight requests if ($request_method = OPTIONS) { add_header Access-Control-Allow-Methods *; add_header Access-Control-Allow-Headers *; } # Path to source alias __DATA_DIR__/; index index.html; location __PATH__/ide { proxy_pass http://localhost:__PORT_IDE__/ide; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/preview { proxy_pass http://localhost:__PORT_PREVIEW__/preview; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/project { proxy_pass http://localhost:__PORT_PROJECT__/project; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/data { proxy_pass http://localhost:__PORT_DATA__/data; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/documents { proxy_pass http://localhost:__PORT_DATA__/documents; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; client_max_body_size 15M; } }