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;