can't get mod_proxy to correctly forward encoded slash (/) characters (%2f)

11,172

Sorry, just got it (3rd answer here), the solution is to use nocanon in the ProxyPass directive,

AllowEncodedSlashes On
ProxyPass / http://myserver:1279/ nocanon

I can delete the question if it's no longer helpful.

Share:
11,172
gatoatigrado
Author by

gatoatigrado

see website (zoratung.com)

Updated on September 18, 2022

Comments

  • gatoatigrado
    gatoatigrado over 1 year

    I have a virtual host set up to redirect ntung-gitblit.localhost --> myserver:1279. However, it's not working with forward encoded slashes (%2f). The URL I'm trying to access is,

    http://ntung-gitblit.localhost/ABC%2fXYZ
    

    Without AllowEncodedSlashes, it fails -- apache tries to access /error/HTTP_NOT_FOUND.html.var on the server. Setting AllowEncodedSlashes to On results in the following internal URL hit,

    http://myserver:1279/ABC/XYZ
    

    And setting AllowEncodedSlashes to NoDecode results in the following URL being hit,

    http://myserver:1279/ABC%252fXYZ
    

    In other, words, it's over-escaping or under-escaping. Question: How do I make it hit myserver:1279/ABC%2fXYZ?

  • Nic
    Nic about 5 years
    Thanks for not being DenverCooper9. xkcd.com/979