Hello,
I have a nginx proxy which does a proxy_pass to a istio service.
server {
listen 3900;
client_max_body_size 0;
index index.html;
server_name localhost;
root /var/www/public;
location /api-url {
rewrite ^/api-url/(.*)$ /$1 break;
proxy_pass https://myapp.com;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $proxy_host;
proxy_cache_bypass $http_upgrade;
}
}
In Istio I have a virtual service for myapp.com
.
I get a 404
through the proxy_pass but a 200
via curl.
curl to nginx “http://localhost:3900/api-url/api/v1/completions?prefix=&field=sessionTags”
Returns a 404
Istio ingressgateway access log for this call:
[2019-11-07T21:22:13.404Z] "GET /api/v1/completions?prefix=&field=sessionTags HTTP/1.1" 404 - "-" "-" 0 0 0 - "10.42.192.0" "curl/7.66.0" "7ec136be-2e62-414f-8cd1-2c2ddfb7b4fd" "myapp.com" "-" - - 10.42.248.13:443 10.42.192.0:57128 -
curl to mimic nginx rewrite: "curl “https://myapp.com/api/v1/completions?prefix=&field=sessionTags”
Returns a 200
Istio ingressgateway access log for this call:
[2019-11-07T21:25:09.553Z] "GET /api/v1/completions?prefix=&field=sessionTags HTTP/1.1" 200 - "-" "-" 0 2 363 362 "10.42.48.0" "curl/7.66.0" "069d6d0a-940a-4bf2-869c-83bdc5a1ce44" "myapp.com" "10.42.140.3:8080" outbound|8080||myapp.mynamespace.svc.cluster.local - 10.42.248.13:443 10.42.48.0:13004 myapp.com
I can’t figure out what the issue is with the nginx proxy_pass
module.