From 491c591c3c4f5c69e1f75ed4906494d3c4cb3716 Mon Sep 17 00:00:00 2001 From: Adam French Date: Sat, 22 Nov 2025 11:28:56 +0000 Subject: [PATCH] rerouting api --- nginx/nginx.conf.template | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index 977c5b7..80f1cf4 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -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;