fix: update Nginx configuration to enforce trailing slashes for admin and API endpoints
All checks were successful
Deploy on Push to Main / deploy (push) Successful in 42s
All checks were successful
Deploy on Push to Main / deploy (push) Successful in 42s
This commit is contained in:
@@ -30,14 +30,6 @@ http {
|
|||||||
listen 7080;
|
listen 7080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location = /mayo-manager/admin {
|
|
||||||
return 301 /mayo-manager/admin/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /mayo-manager/api {
|
|
||||||
return 301 /mayo-manager/api/;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Serwowanie statycznych plików Django Admina
|
# Serwowanie statycznych plików Django Admina
|
||||||
location /mayo-manager/static/ {
|
location /mayo-manager/static/ {
|
||||||
alias /static_django/;
|
alias /static_django/;
|
||||||
@@ -50,7 +42,10 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Proxy do API Django
|
# Proxy do API Django
|
||||||
location /mayo-manager/api/ {
|
location ~ ^/mayo-manager/api/?$ {
|
||||||
|
if ($request_uri !~ /$) {
|
||||||
|
return 301 $request_uri/;
|
||||||
|
}
|
||||||
proxy_pass http://mayo-production-manager-backend:7090/mayo-manager/api/;
|
proxy_pass http://mayo-production-manager-backend:7090/mayo-manager/api/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
@@ -59,7 +54,10 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Proxy do panelu admina Django
|
# Proxy do panelu admina Django
|
||||||
location /mayo-manager/admin/ {
|
location ~ ^/mayo-manager/admin/?$ {
|
||||||
|
if ($request_uri !~ /$) {
|
||||||
|
return 301 $request_uri/;
|
||||||
|
}
|
||||||
proxy_pass http://mayo-production-manager-backend:7090/mayo-manager/admin/;
|
proxy_pass http://mayo-production-manager-backend:7090/mayo-manager/admin/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user