For paths with an extension, give 404 if missing (#17035)
This commit is contained in:
parent
4456687400
commit
24655f6ceb
|
|
@ -28,7 +28,8 @@ server {
|
|||
server_tokens off;
|
||||
|
||||
root /opt/appsmith/editor;
|
||||
index index.html index.htm;
|
||||
index index.html;
|
||||
error_page 404 /;
|
||||
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
|
||||
add_header Content-Security-Policy "frame-ancestors ${APPSMITH_ALLOWED_FRAME_ANCESTORS-'self' *}";
|
||||
|
|
@ -66,6 +67,11 @@ server {
|
|||
try_files \$uri /index.html =404;
|
||||
}
|
||||
|
||||
# If the path has an extension at the end, then respond with 404 status if the file not found.
|
||||
location ~ \.[a-z]+$ {
|
||||
try_files \$uri =404;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ server {
|
|||
server_tokens off;
|
||||
|
||||
root /opt/appsmith/editor;
|
||||
index index.html index.htm;
|
||||
index index.html;
|
||||
error_page 404 /;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /appsmith-stacks/data/certificate/certbot;
|
||||
|
|
@ -83,6 +84,11 @@ server {
|
|||
try_files \$uri /index.html =404;
|
||||
}
|
||||
|
||||
# If the path has an extension at the end, then respond with 404 status if the file not found.
|
||||
location ~ \.[a-z]+$ {
|
||||
try_files \$uri =404;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user