i have this NGINX location in my default.conf
location /api-gateway/ {
proxy_http_version 1.1;
proxy_connect_timeout 75s;
proxy_read_timeout 100s;
client_max_body_size 100m;
proxy_set_header Host test.domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_buffers 16 8k;
proxy_buffer_size 4k;
proxy_max_temp_file_size 0;
rewrite ^/api-gateway/(.*)$ $1 break;
proxy_pass http://ingress-srv; # ingress-srv is an upstream
}
here is an example of the request that is coming to my NGINX server: http://demo.domain.com/api-gateway/service/v1/metrics
i need to do the below
- remove the
/api-gateway/from the original url and then, - rewrite/send the requests to
ingress-srvupstream without changing the URL (no redirect) - change the header from
demo.domain.comtotest.domain.comwhich i believe i have done it correctly
i can not make it work ..