Haproxy change part of url - Server Fault
serverfault.com › questions › 799997Aug 30, 2016 · # Clean the request and remove any existing header named X-Rewrite http-request del-header X-REWRITE # Copy the full request URL into X-Rewrite unchanged http-request add-header X-REWRITE %[url] if { path_beg /old_path } # Change the X-REWRITE header to contain out new path http-request replace-header X-REWRITE ^/old_path(/.*)?$ /new_path\1 if { hdr_cnt(X-REWRITE) gt 0 } # Perform the 301 redirect http-request redirect code 301 location http://%[hdr(host)]%[hdr(X-REWRITE)] if { hdr_cnt(X ...
Haproxy change part of url | Newbedev
newbedev.com › haproxy-change-part-of-urlHaproxy change part of url. With HAProxy 1.5 : use a temporary header to build a new path from the existing one in the request and then directly perform a redirect. # Clean the request and remove any existing header named X-Rewrite http-request del-header X-REWRITE # Copy the full request URL into X-Rewrite unchanged http-request add-header X-REWRITE % [url] if { path_beg /old_path } # Change the X-REWRITE header to contain out new path http-request replace-header X-REWRITE ^/old_path
Haproxy change part of url - Server Fault
https://serverfault.com/questions/79999729.08.2016 · With HAProxy 1.5 : use a temporary header to build a new path from the existing one in the request and then directly perform a redirect # Clean the request and remove any existing header named X-Rewrite http-request del-header X-REWRITE # Copy the full request URL into X-Rewrite unchanged http-request add-header X-REWRITE %[url] if { path_beg /old_path } # …
HAProxy 2.1.2 http-request replace-path not working correctly ...
github.com › haproxy › haproxyFeb 18, 2020 · haproxy-mirror pushed a commit that referenced this issue on Feb 21, 2020. BUG/MINOR: http: http-request replace-path duplicates the query string. 4bbc949. In http_action_replace_uri () we call http_get_path () in the case of a replace-path rule. http_get_path () will return an ist pointing to the start of the path, but uri.ptr + uri.len points to the end of the uri.