Berth through apache mod_proxy

Using Apache virtualhost and mod_proxy, I want to access a java application (myapp), available in a berth instance on port 8080.

Using ProxyPass / localhost:8080/my apache virtual host configuration, I can access the application running on the pier using www.mydomain.com/myapp, but I want the application to be accessible from www.mydomain.com.

An attempt using the ProxyPass / localhost:8080/myappapplication could not be found because the request becomes www.mydomain.com/myappmyapp/.

Then tried using

<Location />
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

I can access the application, but only for the first request. Subsequent requests become www.mydomain.com/myappmyapp/

wiki.eclipse.org/Jetty/Tutorial/Apache apache mod_proxy docs, , www.mydomain.com, :

<Location /myapp/>
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

<Location />
        ProxyPass localhost:8080/myapp/
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</Location>

.

, , . apache , :

[warn] worker localhost:8080/myapp/ already used by another worker
+3
3

, path path/myapp . Apache mod_proxy HTTP () , .

, /myapp , mod_rewrite :

RewriteEngine on
RewriteRule ^/myapp/(.*)$ /$1 [P]

/myapp , ( mod_proxy_html) - /.

+1

, webapp , - . ROOT.war myapp.war ( Jetty, , ).

0

Yes, it works from the root of the pier, but I would like to have more than one application. The configuration for myapp is in the registry context folder:

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/mvc-showcase</Set>
  <Set name="war"><SystemProperty name="jetty.home"/>/webapps/mvc-showcase.war</Set>
</Configure>

my berth version is 6.1.22

0
source

Source: https://habr.com/ru/post/1761615/


All Articles