Wildfly를 사용하는 Apache 역방향 프록시?

Wildfly를 사용하는 Apache 역방향 프록시?

Ubuntu 14.04 시스템에 Apache와 Wildfly가 모두 설치되어 있습니다. 이제 http://localhost:8080Apache( )에서 Wildfly(로컬)에 액세스할 수 있게 만들고 싶습니다 http://webserver/wildfly. 어떻게 해야 합니까?

소파, 저는 두 가지 모드를 활성화했습니다: proxyproxy_http. 그리고 문서 끝에 다음을 추가했습니다 /etc/apache2/apache2.conf.

ProxyRequests off
ProxyPass /wildfly/ http://localhost:8080/
ProxyPassReverse /wildfly/ http://localhost:8080/

편집하다:

이제 절반은 작동하지만 경로가 제대로 변환되지 않습니다. Wildfly에서 실행되는 내 앱 중 하나의 경로는 다음과 같습니다.

http://webserver/wildfly/testproj/Index.xhtml

그러나 해당 페이지의 모든 링크는 다음과 같이 처리됩니다.

http://webserver/testproj/Page1.xhtml
http://webserver/testproj/Page2.xhtml
http://webserver/testproj/Page3.xhtml

이것보다는:

http://webserver/wildfly/testproj/Page1.xhtml
http://webserver/wildfly/testproj/Page2.xhtml
http://webserver/wildfly/testproj/Page3.xhtml

Wildfly를 로컬로 실행하면 모든 것이 잘 작동합니다. 이를 통해 Apache Reverse Proxy 구성에 오류가 있음이 틀림없다고 믿을 수 있습니다. 그렇죠? Apache가 올바른 주소/링크를 구문 분석하도록 하려면 어떻게 해야 합니까?

답변1

문제가 해결되었기를 바랍니다. 하지만 이 질문에 대한 답변이 필요한 다른 사람이 있는 경우 여기에서 해결책을 찾아보세요.

EAR 파일 외부에 배포되는 웹 애플리케이션의 경우(WAR 배포)

web-inf 폴더에

MyApp/src/main/webapp/WEB-INF/

이 내용이 포함된 jboss-web.xml 파일을 추가하세요. 여기서 /는 루트 배포입니다. 귀하의 경우 루트로 배포하려면 "/"를 "testproj"로 변경하세요.

<jboss-web>
      <context-root>/</context-root>
</jboss-web>

EAR 파일

공식 문서(참조 확인)에서 EAR 파일 내에서 컨텍스트 루트가 application.xml 파일에 정의되어 있음을 확인할 수 있습니다. 다음 예에서 web-client.war의 컨텍스트 루트는 은행이므로 애플리케이션은 /bank로 설정됩니다. 이는 URL이 www.domaine.com/bank가 됨을 의미합니다.

 <module>
    <ejb>bank-ejb.jar</ejb>
</module>
<module>
    <web>
        <web-uri>web-client.war</web-uri>
        <context-root>bank</context-root>
    </web>
</module>

참조 : Jboss Doc - 6장. 웹 애플리케이션의 컨텍스트 루트 설정

관련 정보