Nginx
rewrite reverse proxy 🔗︎
server {
listen 80
server_name example.com
location /api/ { proxy_pass http://backend-server:8080/ } }
- proxy-pass: Forwards the request to the specified backend server
```nginx
server {
listen 80;
server_name example.com;
location /old-api/ {
rewrite ^/old-api/(.*)$ /new-api/$1 break;
proxy_pass http://backend-server:8080;
}
}
- rewrite
- Match the path and replace it with new-api
- break indicates stopping the processing of subsequent rewrite rules
Be the first to know when I post cool stuff
Subscribe to get my latest posts by email.
Thanks for signing up! Check your email to confirm your subscription.
Whoops, we weren't able to process your signup.