I have one NGINX acting as reverse proxy. I need to remove a substring string_1 from the URL, the rest of the URL is variable.
Example:
Origin: http://host:port/string_1/string_X/command?xxxxx
Destination: http://internal_host:port/string_X/command?xxxxx
nginx.conf:
location /string_1/ {
proxy_pass http://internal_host:port/$request_uri$query_string;
Thanks,
@pcamacho
$uri. You may workaround with arewrite ^/string_1(.*) $1 break;and then useproxy_pass http://$host/$uri;. This$uriis the correct one, changed by the rewrite – higuita Mar 05 '18 at 20:22