Apache2 [SOLVED]: Apache2 Port map via Proxy but keep path

Apache2 [SOLVED]: Apache2 Port map via Proxy but keep path

Home Forums Apache2 Apache2 [SOLVED]: Apache2 Port map via Proxy but keep path

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36903

    Anonymous

    QuestionQuestion

    I have a https://website I want to map

    https://website/app

    to send and receive data from local server on port

    http://localIP:port/

    And if http://localIP:port/ returns something

    http://localIP:port/something

    Then this should be mapped back to

    https://website/app/something

    I want to keep https://website/app/ for all the links of localserver

    Using Apache 2.4.25 on Debian

    Any config examples would be of great help… Searched online for solution

    Here is what happens for my current configuration

    The ip:port/something is mapped to website/something not website/app/something

    #36904

    Anonymous

    Accepted AnswerAnswer

    Inside VirtualHost this is my WORKING config

    MY CONFIG works for your website/app/

    CLIENT —- INTERNET —- ROUTER —- (lan) —- (https)APACHE + (http)LOCAL

    ProxyPass /app/ http://<IP>:<PORT>/     
    ProxyPassReverse /app/ http://<IP>:<PORT>/  
    ProxyHTMLURLMap http://<IP>:<PORT>/ /app/   
    <Location /app/>
        ProxyHTMLEnable On                                     #### v2.1 min
        ProxyHTMLExtended on
        ProxyPassReverse /
        ProxyHTMLURLMap http://<IP>:<PORT> /app/
        ProxyHTMLURLMap / /app/
        ProxyHTMLURLMap /app/ /app/
        RequestHeader unset Accept-Encoding
    
        #AuthType Basic
        #AuthName "Restricted Content"
        #AuthUserFile /LINK/TO/.htpasswd/FILE
        #Require valid-user     
    </Location>
    

    The above maps website/app/ but doesn’t work for website/app

    I also have a problem mapping website/app

    Source: https://stackoverflow.com/questions/47996410/apache2-port-map-via-proxy-but-keep-path
    Author: Luffy
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.