设置 mod_proxy 将 http 身份验证传递给服务器
我在将 Apache 配置为代理服务器时遇到问题。目前,我通过端口 80 使用domain.net 访问 MS Sharepoint 安装。在使用它之前,我必须输入用户名和密码。到目前为止,一切都很好。
现在我希望能够通过子域 web.domain.net 访问网站。托管该站点的服务器在内部网络中的另一台计算机上运行。我想出的解决方案是将端口 80 重定向到运行 apache 的计算机来为新网站提供服务,并将任何对共享点的请求代理到共享点服务器。
到目前为止,我启用了 httpd.conf 中的所有代理模块并添加了虚拟主机。 编辑:第一次响应后更新配置。
<VirtualHost *:80>
ServerName domain.net
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyErrorOverride On
ProxyPass / http://sharepoint/
ProxyPassReverse / http://sharepoint/
<Location />
AuthType basic
AuthBasicAuthoritative Off
SetEnv proxy-chain-auth On
Order allow,deny
Allow from all
</Location>
</VirtualHost>
这有效。输入domain.net会将我转发到sharepoint服务器。现在真正的问题来了。共享点要求我提供凭据。但是,当我输入它们时,由于我没有输入或不正确输入用户名和密码,登录表单不断弹出。
似乎凭据没有通过代理转发到共享点。
你能给我一些如何解决这个问题的建议吗?是否可以使用 mod_proxy 来做到这一点?
I have a problem configuring Apache as a proxy server. At the moment I access a MS Sharepoint installation using domain.net over Port 80. Before being able to use it I have to enter username and password. So far so good.
Now I want to be able to access a website over a subdomain web.domain.net. The Server hosting this site runs on another machine in the internal network. The solution I came up with is to redirect port 80 to the machine running apache to serve the new website and proxy any requests for the sharepoint to the sharepoint server.
So far I enabled all the proxy modules in my httpd.conf and added a virtual host.
EDIT: Updated config after first responses.
<VirtualHost *:80>
ServerName domain.net
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyErrorOverride On
ProxyPass / http://sharepoint/
ProxyPassReverse / http://sharepoint/
<Location />
AuthType basic
AuthBasicAuthoritative Off
SetEnv proxy-chain-auth On
Order allow,deny
Allow from all
</Location>
</VirtualHost>
This works. Entering domain.net forwards me to the sharepoint server. Now comes the actually problem. The sharepoint asks me for my credentials. But when I enter them the login form keeps popping up as I entered no or incorrect username and password.
It seems like the credentials aren't forwarded to the sharepoint through the proxy.
Can you give me any advise how to solve this? Is it possible to do this using mod_proxy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅http://httpd.apache.org/docs/2.2/mod/mod_proxy_http。 html:有一个
proxy-chain-auth
环境变量,应将凭据转发到代理服务器。See http://httpd.apache.org/docs/2.2/mod/mod_proxy_http.html: there is a
proxy-chain-auth
environmental variable that should forward the credentials on to the proxied server.