Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
apache的双代理语句_Apache_Tomcat_Proxy - Fatal编程技术网

apache的双代理语句

apache的双代理语句,apache,tomcat,proxy,Apache,Tomcat,Proxy,正如你所看到的,我正试图让/and/BowlingFacelets/faces/指向同一个地方 问题是,当我使用表单时,JSF页面将添加/BowlingFacelets/faces/。但是,我不希望最终用户必须键入这么长的语句才能启动应用程序。有办法做到这一点吗 请注意,如果我手动添加 score.megahooked.com/BowlingFacelets/faces to the URL ProxyPass / http://megahooked.com:8080/ ProxyPassRev

正如你所看到的,我正试图让/and/BowlingFacelets/faces/指向同一个地方

问题是,当我使用表单时,JSF页面将添加/BowlingFacelets/faces/。但是,我不希望最终用户必须键入这么长的语句才能启动应用程序。有办法做到这一点吗

请注意,如果我手动添加

score.megahooked.com/BowlingFacelets/faces to the URL
ProxyPass / http://megahooked.com:8080/
ProxyPassReverse / http://megahooked.com:8080/
这将无法正常工作

score.megahooked.com/createEvent.xhtml
因为在提交新URL时 找不到score.megahooked.com/BowlingFacelets/faces/updateEvent.xhtml


解决方案可能是使用mod_proxy_html。它可以解析HTML文档并重写其中的URL。例如,在这里,我使映射到/restfrontend的应用程序restfrontend可以作为映射到的根应用程序访问/

ProxyHTMLEnable On
ProxyHTMLExtended On
ProxyHTMLMeta On
ProxyHTMLLogVerbose On
ProxyHTMLURLMap ^/restfrontend()$ $1 [LR]
ProxyHTMLURLMap /restfrontend/ /

ProxyPassReverseCookiePath /restfrontend /
ProxyHTMLDoctype HTML
我强烈反对这样做的建议。这个模块很难配置。同时配置两条可能的路径将是一场噩梦

更好的解决方案是直接在Tomcat中将应用程序部署为ROOT用户,并使用[R=301]选项为其他URL添加一些重定向

ProxyHTMLEnable On
ProxyHTMLExtended On
ProxyHTMLMeta On
ProxyHTMLLogVerbose On
ProxyHTMLURLMap ^/restfrontend()$ $1 [LR]
ProxyHTMLURLMap /restfrontend/ /

ProxyPassReverseCookiePath /restfrontend /
ProxyHTMLDoctype HTML