Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Correctly route /openapi.json and /api/* paths in Nginx config #1138

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion deployment/data/nginx/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ server {

client_max_body_size 5G; # Maximum upload size

location ~ ^/api(.*)$ {
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths
rewrite ^/api(/.*)$ $1 break;

# misc headers
Expand Down
4 changes: 3 additions & 1 deletion deployment/data/nginx/app.conf.template.dev
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ server {

client_max_body_size 5G; # Maximum upload size

location ~ ^/api(.*)$ {
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths
rewrite ^/api(/.*)$ $1 break;

# misc headers
Expand Down
4 changes: 3 additions & 1 deletion deployment/data/nginx/app.conf.template.no-letsencrypt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ server {

client_max_body_size 5G; # Maximum upload size

location ~ ^/api(.*)$ {
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths
rewrite ^/api(/.*)$ $1 break;

# misc headers
Expand Down