rerouting api

This commit is contained in:
2025-11-22 11:28:56 +00:00
parent 741723246c
commit 491c591c3c

View File

@@ -57,12 +57,13 @@ http {
root /var/www/certbot;
}
location = /posts {
return 301 /posts/;
location = /api {
return 301 /api/;
}
location /posts/ {
proxy_pass http://$BACKEND_HOST:$BACKEND_PORT/posts;
location /api/ {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://$BACKEND_HOST:$BACKEND_PORT;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;