I to proxy /api
on a domain, I have this location block.
location ^~ /api/ {
rewrite_log on;
rewrite ^/api/(.*) /$1$is_args$args break;
proxy_pass http://127.0.0.1:1337;
}
It works fine as long as the URLs do not have query parameters, but as soon as they do, I get errors on the upstream server like these Could not find path: /records%3fname=hoegh.io
The %3f
in question here is an URL encoded ?
, and since it's URL encoded, the upstream server does not recognize it. That might be retarded, but I was hoping it was possible to get nginx to handle this correctly (ie. not escape the URL before passing it to the proxy).
Any ideas?