ProxyPassMatch 指令问题
我们有一个环境,其中 Apache 2.2.11 充当 Tomcat 后端服务器传入连接的前端。 我们在 http-ssl.conf 中使用以下指令,在不尝试捕获 403 错误时效果很好:
SetEnvIf COMPANY EDLP 4.0.1 NLEDLPKEY=true
虚拟主机的一般设置 DocumentRoot "C:/xampp/htdocs/"
服务器名称 localhost:443 ServerAdmin admin@localhost
ProxyRequests Off
ProxyPassMatch / htp://tomcat.company.com**<-- 此指令存在问题(仅在 http 中使用一个“t”来绕过此站点 新用户每个只能发布一个 URL问题限制**
ProxyPassReverse / htp://tomcat.company.com
如您所见,我们使用 mod_access (现在在 Apache 2.2 中称为 mod_authz_host)模块来传递名为 NLEDLPKEY 的变量,以便只有具有此变量的 (Internet Explorer) 客户端可以通过 SSL 访问 Tomcat。另外,我不仅尝试反向代理 SSL 连接,还尝试将 403 错误(对于没有变量的人)重定向到指定页面(error_page.html):
ProxyPassMatch“^ [^(/error_page.html)]" htp://tomcat.company.com 并且还尝试了
ProxyPassMatch “^(?!/error_page.html)” htp://tomcat.company.com
看看是否可以重定向到错误页面并且不会收到以下消息:
禁止
您无权访问此服务器上的 /RDS <--RDS 只是一个目录-->
此外,尝试使用 ErrorDocument 处理请求时遇到 403 Forbidden 错误。 Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 服务器位于 apache-company 端口 443
任何帮助将不胜感激
R.
We have an environment with Apache 2.2.11 acting as front end to incoming connections to a Tomcat backend server. We are using the following directives in the http-ssl.conf, which works great when not trying to catch 403 errors:
SetEnvIf COMPANY EDLP 4.0.1 NLEDLPKEY=true
General setup for the virtual host
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost:443
ServerAdmin admin@localhost
ProxyRequests Off
ProxyPassMatch / htp://tomcat.company.com**<-- been having issues with this directive (using only one "t" in http to bypass this sites new user can only post one URL per question limitation**
ProxyPassReverse / htp://tomcat.company.com
As you can see we are using the mod_access (now called mod_authz_host in Apache 2.2) module to pass a variable called NLEDLPKEY so that only (Internet Explorer) clients with this variable could access Tomcat via SSL. Also, I am trying to not only reverse proxy SSL connections, but also to redirect the 403 errors (for people without the variable) to a specified page (error_page.html). I have tried:
ProxyPassMatch "^[^(/error_page.html)]" htp://tomcat.company.com and also tried
ProxyPassMatch “^(?!/error_page.html)” htp://tomcat.company.com
to see if it is possible to redirect to the error page and not get the below message:
Forbidden
You don't have permission to access /RDS on this server. <--RDS is just a directory-->
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 Server at apache-company Port 443
Any help would be appreciated
R.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近遇到了这个问题 - 它花了一些时间,但这是我修复它的方法:
在
/etc/apache2/mods-available/proxy.conf
(Ubuntu - YMMV) 中将其更改为如下所示以下内容:还需要注意的是,对于反向代理,没有必要配置
ProxyRequests On
,并且与Allow from all
结合使用是危险的。 (垃圾邮件发送者可以使用它通过您的代理发送邮件。)I ran into this issue recently - it took a bit of hunting but here's how I fixed it:
In
/etc/apache2/mods-available/proxy.conf
(Ubuntu - YMMV) change it to look like the following:It's also important to note that for reverse proxies, it is not necessary to have
ProxyRequests On
configured and doing so in conjunction withAllow from all
is hazardous. (Can be used by spammers to send mail via your proxy.)