ProxyPassMatch 指令问题

发布于 2024-07-29 18:18:18 字数 1140 浏览 3 评论 0原文

我们有一个环境,其中 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天旳寂寞 2024-08-05 18:18:18

我最近遇到了这个问题 - 它花了一些时间,但这是我修复它的方法:

/etc/apache2/mods-available/proxy.conf (Ubuntu - YMMV) 中将其更改为如下所示以下内容:

<Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Deny from all
        Allow from all
</Proxy>

还需要注意的是,对于反向代理,没有必要配置 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:

<Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Deny from all
        Allow from all
</Proxy>

It's also important to note that for reverse proxies, it is not necessary to have ProxyRequests On configured and doing so in conjunction with Allow from all is hazardous. (Can be used by spammers to send mail via your proxy.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文