From 1089d48b7c97b3cbab2bab2c420e59233c531931 Mon Sep 17 00:00:00 2001 From: stuppie Date: Thu, 24 Sep 2026 16:12:42 -0600 Subject: nginx move slash rewrite into location / block so docs is accessable without a slash --- nginx_amt-jb.conf | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nginx_amt-jb.conf b/nginx_amt-jb.conf index 0b0f385..a9f1a9f 100644 --- a/nginx_amt-jb.conf +++ b/nginx_amt-jb.conf @@ -16,9 +16,6 @@ server { # max upload size client_max_body_size 1M; # adjust to taste - # Internally add a trailing slash while preserving the request method and body. - rewrite ^([^.]*[^/])$ $1/ break; - location = /favicon.ico { access_log off; return 200 '{}'; @@ -30,20 +27,22 @@ server { return 200 '{"status":"ok"}'; } - location = /docs/ { + location = /docs { include nginx_amt-jb_proxy_pass.conf; - proxy_pass http://uvicorn/docs; + proxy_pass http://uvicorn; } - location = /redoc/ { + location = /redoc { include nginx_amt-jb_proxy_pass.conf; - proxy_pass http://uvicorn/redoc; + proxy_pass http://uvicorn; } - location / { - include nginx_amt-jb_proxy_pass.conf; - proxy_pass http://uvicorn; - add_header Cache-Control "no-store, no-cache, must-revalidate"; + location / { + # Internally add a trailing slash while preserving the request method and body. + rewrite ^([^.]*[^/])$ $1/ break; + include nginx_amt-jb_proxy_pass.conf; + proxy_pass http://uvicorn; + add_header Cache-Control "no-store, no-cache, must-revalidate"; } } -- cgit v1.2.3