#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { # CORS support more_set_headers 'Access-Control-Allow-Origin: *'; # Handling preflight requests if ($request_method = OPTIONS) { more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; return 200; } # 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 { if ($request_method = OPTIONS) { more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; return 200; } proxy_pass http://localhost:__PORT_PROJECT__/project; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/data { if ($request_method = OPTIONS) { more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; return 200; } proxy_pass http://localhost:__PORT_DATA__/data; proxy_set_header Host $host; proxy_read_timeout 86400s; proxy_send_timeout 86400s; } location __PATH__/documents { if ($request_method = OPTIONS) { more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; return 200; } 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; } }