我试图build立一个也代理LDAP基本身份validation的Apache代理: <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ProxyPass / http://localhost:8080/ nocanon ProxyPassReverse / http://localhost:8080/ ProxyPreserveHost On ProxyRequests Off AllowEncodedSlashes NoDecode RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" <Location /> AuthType Basic AuthName "LDAP Login for access" AuthBasicProvider ldap AuthLDAPBindDN USER@DOMAIN AuthLDAPBindPassword PASSWORD AuthLDAPURL ldaps://FQDN:636/CN=..,OU=..?uid?sub Require valid-user </Location> ProxyPass在没有AuthType Basic部分的情况下工作,但是,如果合并,BasicAuth会要求input凭据,然后服务器会抛出一个500错误,而不会在他的error.log 我错过了什么?
Apache Httpd被用作两个端点服务器之间的负载平衡器。 每个服务器都有自己的HTTPauthentication。 目标是将端点身份validation传递给用户,用户input其凭据,并将身份validation传回到terminal服务器。 当我将Apache设置为反向代理时,身份validation将毫无问题地通过。 当我到本地主机,我得到提示凭据,我input他们,然后网站工作正常。 这是我的反向代理的configuration: <VirtualHost *:80> ProxyPass "/" "http://serv123:27001/" ProxyPassReverse "/" "http://serv123:27001/" <Location "/"> SetEnv proxy-chain-auth On </Location> </VirtualHost> 但是,当我添加负载平衡,似乎proxy-chain-authconfiguration不正确。 当我input凭据时,我立即得到提示,好像他们没有正确input。 <VirtualHost *:80> ProxyPass "/" "balancer://mycluster/" ProxyPassReverse "/" "balancer://mycluster/" <Location "/"> SetEnv proxy-chain-auth On </Location> <Proxy "balancer://mycluster"> BalancerMember "http://serv123:27001/" BalancerMember "http://serv456:27001/" </Proxy> </VirtualHost> 我也尝试过<Location "balancer://mycluster">和<Location "balancer://mycluster/"> ,但没有成功。 有谁知道正确的方式通过负载平衡的Apache Httpd身份validation?
我们的应用程序最初使用一个安装了mod_perl的Apache服务器来提供所有的HTTPS请求。 由于内存问题,我添加了一个较轻的Apache安装,并使用ProxyPass将Perl请求交给启用了mod_perl的服务器。 我们目前在mod_perl服务器上安装了一个SSL证书,但是我很难理解我们是否需要两台服务器的证书,或者只有接收原始请求的轻量级服务器。 或者一个证书可以用于一台机器上的多台服务器? 预先感谢任何帮助/指针。
我试图设置用户子域名,提供来自特定文件夹的内容: www.example.com/username从username.example.com (就像github页面)。 我看了Nginx重写,但我不希望浏览器redirect – 我想要的域名是username.example.com。 无论如何,对这个问题的评论说,我不能重写主机,只能代理它。 我尝试设置一个proxy_pass ,但所有的文档和示例显示它被用来(显然)代理到另一个主机或端口上的服务,但在我的情况下,我只想代理到另一个位置在同一个主机和端口。 这是解决这个问题的适当方法吗?如果是的话,那么正确的Nginxconfiguration语法是什么?
httpd.conf的虚拟主机看起来像这样: <VirtualHost *:9999> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com # Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /var/www/html/example.com/wordpress ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8888/ ProxyPassReverse / http://www.example.com:9999/ #ProxyPassReverseCookieDomain localhost:8888 www.example.com:9999/ ProxyPassReverseCookiePath / / </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com # Indexes + Directory Root. DirectoryIndex […]
我使用Nginx来代理传递给我的wsgi应用程序与马戏团服务。 我想允许通过该应用程序的stream量只为一些IP地址的一些应用程序的url。 现在看起来像这样: server { listen 80; server_name service.dev; access_log /var/log/service.access.log; error_log /var/log/service.error.log debug; location / { try_files $uri @proxy_to_app; } location @proxy_to_app { proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://127.0.0.1:9000/; } location /admin/ { allow 192.168.5.0/24; deny all; } } 但它不起作用。 如果我有权利,我得到一个404错误,而不是proxy_pass。 你知道我怎么做,而不必每次都复制/粘贴proxy_passconfiguration? 谢谢。
我们正在代理后端,我们不控制后端在https上连接时请求客户端证书。 当我们通过代理请求这些页面时,连接超时而后端没有响应,但是如果我们绕过代理,页面就可以正常工作。 这是处理客户端证书的nginx问题,还是应该在其他地方看? Nginxconfiguration: server { listen 443 ssl; ssl on; ssl_certificate /etc/nginx/ssl/webserver.pem; ssl_certificate_key /etc/nginx/ssl/webserver.key; location / { proxy_pass https://www.backendsite.com; proxy_set_header X-Forwarded-For $http_x_forwarded_for; } }
我想要做的是代理请求从http://example.com/proxy/foo到http://localhost:8060/foo 这个configuration代理http://example.com/proxy/foo到http://localhost:8060/proxy/foo server { server_name example.com; location /proxy/ { proxy_pass http://localhost:8060; } location / { proxy_pass http://localhost:8040; } }
我们有一个QA版本,一个UAT版本和一个DEV版本的webapp。 用户需要通过http://uat.company.com:41002/webapp和http://dev.company.com:41002/webapp进入。 在端口41001上还有一个不同的webapp,他们也需要访问端口8080。 这些url需要在公司外部可用,我们只有一个公共IP地址可以访问。 因为这样的DNSlogging需要全部3个地址来指向一个IP。 在单个IP地址上,服务器驻留在运行nginx。 在后台我需要每个url指向一个不同的服务器 http://uat.company.com –> 123.123.123.1 http://qa.company.com –> 123.123.123.2 http://dev.company.com –> 123.123.123.3 恐怕我不知道正确的术语,但是URI和端口的其余部分也必须结转到IP地址。 即如果有人访问 http://uat.company.com:41002/webapp/somepage` 它会看起来好像是他们访问的页面,但他们真的会看 http://123.123.123.1:41002/webapp/somepage 或者如果他们访问 http://qa.company.com:8080/static/home.html 他们真的会在看 http://123.123.123.2:8080/static/home.html 但他们的浏览器仍然会说http://qa.company.com:8080/static/home.html 我努力了 server { server_name uat.company.com; listen 41001; listen 41002; listen 8080; location / { proxy_pass http://123.123.123.1:$server_port$uri; proxy_set_header Host $host; } } 但是,这给了我一个坏的网关502页与日志: 2015/01/28 16:04:49 [crit] 30571#0: *1 connect() to […]
这是我的用例。 我想学习如何设置Apache ,所以这只是为了学习。 随意build议更好的select。 我在RHEL5使用Apache 2.4 。 我想使用ProxyPassMatch代理到两个不同的站点 ProxyPassMatch "^/(a|b)/(*.jpg)$" https://$1.example.com/$2 但是a.example.com和b.example.com需要不同的客户端证书。 我补充说 SSLProxyEngine on SSLProxyMachineCertificateFile /path/certs/webs.pem 如果webs.pem的内容只有一对(证书和私钥),则可以很好地连接到正确的站点。 但是,如果我添加第二对(证书和私钥)它不起作用。