ProxyPass and DocumentRoot on one domain

后端 未结 3 796
长发绾君心
长发绾君心 2021-02-07 02:27

Let\'s say I have the following configuration:


    # Server names, admins, logs etc...

    ProxyVia On
    ProxyRequests Off
             


        
相关标签:
3条回答
  • 2021-02-07 02:57

    What it is recommending is using mod_rewrite to perform the ProxyPass instead of ProxyPass/ProxyPassReverse command.

    Try something like:

    RewriteRule  ^/forum   -  [L]
    RewriteRule  ^/(.*)    http://localhost:8080/tomcat-webapp/$1  [P,L]
    ProxyPassReverse /     http://localhost:8080/tomcat-webapp/
    
    0 讨论(0)
  • 2021-02-07 03:11

    Actually, I resolved this problem with the following code:

    ProxyPass /forum !
    ProxyPass / http://localhost:8080/tomcat-webapp/
    ProxyPassReverse / http://localhost:8080/tomcat-webapp/
    Alias /forum /var/www/forum
    
    0 讨论(0)
  • 2021-02-07 03:19

    I use:

    <VirtualHost *:80>
    #other irrelevant configs here
    ProxyPass /forum http://localhost:8080/myBB
    ProxyPassReverse /forum http://localhost:8080/myBB
    ProxyPass / http://localhost:8081/tomcat-app
    ProxyPassReverse / http://localhost:8081/tomcat-app
    </VirtualHost>
    

    You don't have to say "tomcat-app" if your tomcat app is the root app.

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