Articles of proxypass

使用https和虚拟主机为nginx设置自定义错误页面

我们有一个作为负载均衡器的nginx(OpenResty 1.4.2.7)实例。 它有两个服务器指令,一个服务于一个特定的站点(让我们称之为www.our-special-host.com)和一个通配符。 我们正在尝试对其进行configuration,以便显示不同的502错误页面,具体取决于两个服务器伪指令的后端是closures的。 我们的configuration适用于HTTP,但不适用于HTTPS。 如果我们closures后端并打到www.our-special-host.com,我们会得到适当的HTTP和HTTPS错误。 但是,如果我们点击了其他托pipe站点,则会得到HTTP的正确错误页面,但对于HTTPS,我们会获得www.our-special-host.com的错误页面。 这里是我们的configuration(轻度编辑): server { server_name www.our-special-host.com listen 80; listen 443 ssl; error_page 502 /nginx_errors/loadbalancer_502_on_special_host.html; location /nginx_errors/ { alias /path/to/nginx_errors/; } location / { proxy_pass xxxx; … } ssl_certificate certificate.crt; ssl_certificate_key pk.key; } server { listen 80; listen 443 ssl; error_page 502 /nginx_errors/loadbalancer_502_on_other_hosts.html; location /nginx_errors/ { alias /path/to/nginx_errors/; } location […]

如何在不破坏客户端和服务器之间的https隧道的情况下configurationapache反向代理?

我configuration了Apache反向代理。 在该configuration中,可以在客户端到反向代理之间进行https连接,并再次向服务器反向代理。 但我希望HTTPS连接客户端之间的服务器像转发代理。 https连接不应该在反向代理中被破坏。 Https tunnel New Https tunnel <===============> <===================> 客户端———————– Apache反向代理———————– – – -服务器 以上解决scheme是不可取的 。 Https Tunnel <========================================> 客户端——————– Apache反向代理——————–服务器 以上解决scheme是可取的 如果在反向代理中不可能使用端到端的https隧道,那么如何才能确保ssl代理选项是安全的,即使是反向代理pipe理员(如果反向代理被攻陷)也不能解密中间人攻击的隧道或者不能做完了。

ProxyPassReverse不使用302redirect

我正在使用Apache HTTPD代理本地Tomcat服务器: ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ 一切工作正常,除非我有一个302redirect。 出于某种原因,ProxyPassReverse不会重写localhost:8080,客户端将被redirect到localhost:8080,从而导致浏览器错误。 我怎样才能得到ProxyPassReverse 302redirect工作?

Nginx基于参数中的关键字redirect

我对nginx非常陌生(大约1天左右),我们正在使用它作为一些应用程序的反向代理。 我们将添加另一个将处理现有请求的一小部分的应用程序。 我正试图拦截那些碰到鳕鱼/文章API并在参数中包含item.id的url,然后把这些请求和它们的参数发送到这个我现在所没有准备好的新应用程序。 我想单独留下所有其他请求,即API不是“/ cod / acticles”,请求在参数中不包含item.id。 应该发送到新应用程序的示例url。 http://server/mdata/transfer/CUSTOMER/cod/articles?filter={"item.id":"ID00000000123"……}&limit=50&fields=[]&sort=……. 不应该发送的示例url。 http://server/mdata/transfer/customer/cod/articles?filter{"lang":"en_US","article.id":"123456"}&limit=50…. http://server/mdata/transfer/customer/cod/items?filter{"lang":"en_US","article.id":"123456"}&limit=50…. http://server/mdata/transfer/customer/doc/articles?filter{"lang":"en_US","article.id":"123456"}&limit=50…. 注意:….只是意味着其他参数 以下是我目前在Nginx中的configuration。 它似乎做了“拦截”,但有一些东西看起来不对我。 首先,我相信使用“如果”并不理想,可能有更好的方法来做到这一点。 但是我没有成功的匹配参数部分。 其次,nginx访问日志显示3个匹配url的请求。 X2301响应和1200响应。 这是预期的吗? 如果是这样,有一个更好的方法来做到这一点,只有一个请求,因为它似乎我已经创build了Nginx的附加负载。 #existing config for all /mdata/transfer/* APIs location /mdata/transfer/ { add_header Access-Control-Allow-Origin *; allow all; proxy_pass http://mds; } #static page which acts as a stub end point for testing. location /proxyapp { root /opt/www; […]

ProxyHTMLEnable设置为ON时禁用超链接

我正在使用逆向代理( proxypass和proxypassreverse )背后的应用程序。 当我将ProxyHTMLEnable设置为ON时,我不明白为什么超链接被禁用(不可点击)。 请注意,涉及的页面包含: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 当我检查日志时,我发现这个消息: 非HTML内容; 不插入代理的HTMLfilter 更新: 这就是代理背后的样子: 这就是它应该是这样的: 请注意,由于相对path,我正在使用ProxyHTMLEnable。 当我这样做,它正常工作: ProxyPass /myapp http://192.168.1.55:8080/myapp Keepalive=On timeout=600 ProxyPassReverse /myapp http://192.168.1.55:8080/myapp 当我这样做,它不会: ProxyPass /testenv/ http://192.168.1.55:8080/ Keepalive=On timeout=600 ProxyPassReverse /testenv/ http://192.168.1.55:8080/

是否有可能通过ApacheredirectVPNstream量

在我的实验室里有一个Apache服务器。 只有80端口被打开。 我可以在上面安装软件。 是否可以安装一些VPN工具并通过ApacheredirectVPN通信? 换句话说,我的VPN客户端发送一个类似于“ https:// webserver / VPN ”的请求,Apache收到它并将数据传送到同一台机器上的VPN服务器,然后把这个响应转发给我的VPN客户端。 可能吗?

我是否需要在应用程序服务器上使用SSL证书?

我有一个三层部署(networking服务器,应用程序,数据库)。 我已经在networking服务器(Apache)上应用了SSL证书。 在基于PHP的应用程序服务器上还有另一个应用程序。 此应用程序的请求通过virtualhost.conf文件中的ProxyPass指令从Web服务器路由。 当我从应用程序服务器请求应用程序时,出现“mixedcontent”错误(通过https连接提供的http内容)。 我的问题: 1.我是否需要应用程序服务器上的SSL证书? 2.我如何得到这个错误消失?

Apache 2.4 RequestHeader,而ProxyPass反向代理

我正在使用Ubuntu 14.04,并且有多个Apache HTTP VirtualHosts在端口80上侦听。一个站点是在本地主机上侦听的应用程序的反向代理。 Apache具有为该站点上的根位置configuration的基本身份validation。 这里是Apacheconfiguration: <VirtualHost *:80> DocumentRoot /home/korisnik/site Alias /static /home/korisnik/site/static <Directory /home/korisnik/site/static> Require all granted </Directory> ProxyPass /static ! ProxyPass / http://127.0.0.1:9002/ ProxyPassReverse / http://127.0.0.1:9002/ RequestHeader set X-Proxy-USER %{REMOTE_USER}e # RequestHeader set X-Proxy-SECURE-USER %{REMOTE_USER}s RequestHeader set X-Foo "Bar" <Location /> AuthType Basic AuthName "Authentication Required" AuthUserFile "/home/korisnik/htpasswd" Require valid-user </Location> </VirtualHost> 我的目标是通过ENVvariables将已通过身份validation的用户的用户名传递给后端应用程序,并且这在一个在Apache中启用了SSL模块的服务器上工作,而在另一个服务器上的相同configuration下,HTTP_X_PROXY_REMOTE_USER […]

nginx – 为什么我不能在proxy_passpath中使用variables?

为什么我不能在proxy_pass中使用variables$ user – 就像下面的例子一样? server { listen 80; server_name ~^(?P<user>[az|AZ|0-9|_|-]+)\.example\.net$; root /home/$user/webapps/; location /app/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://unix:/home/$user/webapps/app/run/gunicorn.sock:/; } } 这是可能实现还是应该放弃? 而这一个将是完美的,但它也不工作。 server { listen 80; server_name ~^(?P<user>[az|AZ|0-9|_|-]+)\.example\.net$; root /home/$user/webapps/; location ~ ^\/(?P<app>[\w-_]+)(\/.*)?$ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://unix:/home/$user/webapps/$app/run/gunicorn.sock:/; } } 我读了这个和那里 ,但在这里,但没有一个通过Unix套接字覆盖proxy_pass。

Apache和glassfish之间的通信

我们正在使用HTTPD服务器(apache)来处理客户端请求。 请求进一步代理到提供内容的应用服务器(glassfish)。 内容是静态文件(软件映像)。 以下是使用的ProxyPass指令。 ProxyPass /access/sw http://localhost:8080/access/sw 我们希望Apache能够处理静态内容,因为它释放了玻璃鱼从事其他工作。 与此唯一的问题是请求仍然需要被指向玻璃鱼检查业务逻辑。 在运行业务逻辑之后,glassfish服务器应该向Apache发送一个响应,确认允许客户端下载软件映像。 它也可以发送一个负面的回应给Apache拒绝客户端请求。 这怎么可能实现? 有没有任何Apache模块来处理这个? 只是重申,以下是可以实现的吗? Request from client -> Apache -> Glassfish (runs the business logic) -> responds back to Apache if client should be allowed to download -> Apache serves the static file depending on glassfish response PS – 客户端无法处理redirect请求。 客户端发送一个GET