ProxyHTML to rewrite URL

前端 未结 1 444

I\'ve got 2 apache servers set up. One on port 80 and another on port 8077. I\'m wanting to see everything on the server on 8077 via a reverse proxy. At the moment I\'ve got

相关标签:
1条回答
  • 2020-12-14 02:30

    Ok, this is what I ended up doing to get it working

    ProxyPass /translate/ http://www.example.com:8077/
    ProxyPassReverse /translate/ http://www.example.com:8077/
    
    ProxyHTMLURLMap http://www.example.com:8087 /translate/
    
    <Location /translate/>
       ProxyPassReverse /
       SetOutputFilter  proxy-html
       ProxyHTMLURLMap http://www.example.com:8077 /translate/
       ProxyHTMLURLMap / /translate/
       ProxyHTMLURLMap  /translate/ /translate/
       RequestHeader    unset  Accept-Encoding
    </Location>
    

    This seems to work well. The ProxyHTMLURLMap http://www.example.com:8077 /translate/ line was only needed to translate some "referrer" based urls that caused some pages to end up trying to serve directly from the 8077 port server.

    0 讨论(0)
提交回复
热议问题