Articles of 反向代理

对Nginx的Apache ReverseProxy只显示Nginx的默认localhost域

我正在CentOS Nginx上configurationApache ReverseProxy上的Tuleap。 Tuleap在CentOS上成功运行,可以访问。 configuration完反向代理后,我已经使用glassfish和另一个相同的configurationApache服务器工作正常。 但是nginx只显示localhost页面。 查看nginx tuleap主机和apache reverseproxy主机的configuration文件 nginxconfiguration: # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr […]

如何使用IIS8将HTTP请求标题设置为当前date和时间

我目前使用Microsoft IIS8服务器作为URL重写的反向代理。 目前有这个问题,我需要在IIS上设置一个HTTP请求标题。 我已经走了,创造了一个空白的规则,并设置条件。 我如何让IIS在请求头中以特定格式设置当前date和时间? 没有ASP.NET网站,甚至可能吗? 在阅读微软的参考资料时,我没有发现任何这样的事情。 规则的当前状态显示date时间应该是的模式,如果标题不匹配,标题应该被覆盖: <rule name="set clientDate"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_CLIENTDATE}" pattern="[0-9]{4}\-[0-9]{2}\-[0-9]{2}\ [0-9]{2}\:[0-9]{2}\:[0-9]{2}" negate="true" /> </conditions> <action type="None" /> </rule> 提前致谢

nginx设置cookie代理错误

我有一个在tomcat应用程序服务器前面的nginx。 在某些情况下,该应用程序会发送一个HTTP 403响应,以及一个Set-Cookie头,以删除客户端上的无效Cookie。 我也定了 http { proxy_intercept_errors on; } 因为我不希望任何上游错误显示给客户端。 我仍然希望发送这些Set-Cookie头文件。 每403响应发送一次头add_header问题,但是add_header不适用于HTTP状态。 我如何需要改变configuration来实现呢?

Nginx反向代理没有按预期传递请求

我有一个Nginx反向代理启动并运行。 它也提供了一个Web应用程序的前端静态内容。 但是,反向代理没有传递请求。 发生什么事情是,当我尝试从静态页面login时,它正在对http://localhost/apps/iv/rest/Login进行POST。 不过,我需要这个POST到http://localhost/iv360/apps/iv/rest/Login 。 我以为我用/apps/iv/rest/ location块正确,但它似乎没有工作。 这是我完整的configuration文件。 events { worker_connections 1024; } http { upstream https_iv360 { server localhost:9443; } upstream http_iv360 { server localhost; } server { listen 80; location / { proxy_pass https://https_iv360/iv360/; } location /apps/iv/rest/ { proxy_pass http://http_iv360/iv360/; } location /apps/iv/resources/ { root /www/data; } } } 这里是Nginx日志的错误。 2017/11/16 13:26:43 […]

Nginx反向代理导致上游连接在并发负载testing下被拒绝

让我asume我的环境如下: 客户端(Apache的Jmeter负载testing) nginx(docker container runnning nginx:1.12.2) (Docker容器运行embedded式的wild:群:1.2.9) 目前我正在尝试configurationnginx并承诺允许700个并发用户。 负载testing(客户端)以700个并行线程运行,每个线程执行50个请求。 这个请求将会被返回一个简单的JSON的ows / wildfly-swarm服务。 整个环境运行在我的本地设备(之间没有缓慢的networking)。 docker集装箱在他们自己的dockernetworking中运行,并且容器之间的链接使用docker容器名称(正确地parsingdocker容器IP)。 情况1 [client] –> [undertow] 所有的请求被送达。 运行wildfly / undertow的容器似乎能够服务于负载testing(客户端)的请求。 情景2 [client] –> [nginx] –> [undertow] 用下面的configuration将nginxconfiguration为反向代理。 worker_processes 2; events { worker_connections 1024; use epoll; } http { access_log off; error_log /var/log/nginx/error.log; sendfile on; sendfile_max_chunk 512k; tcp_nopush on; tcp_nodelay on; upstream undertow_upstream { […]

使用Apache反向代理服务器为各种服务器提供1个公共IP

我正在为我的服务器使用AWS。 我做了几个本地运行不同的http网站的实例。 (instance1,instance2,…) 我已经注册了一个域example.com并在我的Route 53上创build了一个托pipe区example.com 。 我做了一个运行Apache httpd的实例,我用它作为反向代理。 有了这个服务器,我已经将AWS的公有弹性IP关联了起来。 该服务器与网站服务器位于同一networking中。 之后,我在路由53中创build了一个logging表,使proxy.example.com指向我的代理服务器的公有IP,另一个logging表使instance1.example.com指向其中一个网站托pipe服务器的专用地址。 然后在代理服务器的httpdconfiguration文件中,我添加了以下代码: ProxyPass "/" "http://instance1.example.com/" ProxyPassReverse "/" "http://instance1.example.com/" 如果我现在在任何浏览器中键入proxy.example.com我将被redirect到在instance1上运行的网站,该网站非常整洁。 作为最后一个接触,我现在想通过这个代理服务器将其redirect到不同网站的不同服务器,这取决于我input的子域: 如果我inputinstance1.example.com ,stream量应该去我的代理,然后看到子域,并redirect到我的实例1的stream量。 如果我inputinstance2.example.com ,stream量应该去我的代理,然后看到子域,并redirect到我的实例2的stream量。 等等… 这甚至有可能吗? 我觉得实现我的目标非常接近…但是因为我对这个完整的Apache的东西真的很陌生,所以我需要你的帮助,因为我在网上找不到像这样的场景。 提前感谢任何答案! 解 想通了,并认为我离开我的解决scheme,如果任何人有同样的问题。 我向我的托pipe区域example.com添加了3个新的logging集,全部指向我的代理的公共地址: test.example.com test2.example.com test3.example.com 之后,我将这些代码行添加到我的代理服务器上的httpdconfiguration文件中: <VirtualHost *:80> ServerName test.example.com ProxyPass "/" "http://private IP of webserver1/" ProxyPassReverse "/" "http://private IP of webserver1/" </VirtualHost> <VirtualHost *:80> ServerName […]

对Docker容器的Apache反向代理

我有一个运行在Docker容器上的网站,并且在主机的Apache上创build了一个虚拟主机,这个虚拟主机正在对容器做一个反向代理(在主机的8280端口上)。 所以我有: <VirtualHost *:443> ServerName www.example.com DirectoryIndex index.php index.html SetOutputFilter SUBSTITUTE,DEFLATE ProxyPass / http://localname:8280/ ProxyPassReverse / http://localname:8280/ Substitute "s|http://localname:8280/|https://www.example.com/|i" SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateKeyFile /path-to/privkey.pem SSLCertificateFile /path-to/cert.pem SSLCertificateChainFile /path-to/chain.pem <Proxy *> Order deny,allow Allow from all Allow from localhost </Proxy> </VirtualHost> <VirtualHost *:80> ServerName www.example.com ServerAlias www.example.com Redirect permanent / https://www.example.com/ </VirtualHost> […]

nginx似乎没有转发资源

我试图代理一个https网站,我希望人们能够像在真实的网站上一样浏览我的代理,我也想修改应得的内容(在将来)。 通过proxy_pass,我可以代理主页面,只要我尝试访问位于真实网站上的资源或发送http post / get data我得到一个404 Not Found错误 /etc/nginx/nginx.conf user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; # multi_accept on; } http { server_tokens off; ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; […]

如何在centos 6 cpanel帐户上configurationapache反向代理

我的服务器正在运行centos 6和apache 2.3 web服务器; 我想在我的cpanel主域上configurationSSL终止反向代理。 我使用whm已经在域上安装了SSL证书,但是我需要的是在此示例中configuration反向代理: SSLStrictSNIVHostCheck off <VirtualHost *:80> Redirect permanent / https://www.example.com/ ServerName example.com ServerAlias www.example.com </VirtualHost> <VirtualHost *:443> ServerName www.example.com ProxyPreserveHost On ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ SSLEngine on SSLProtocol all -SSLv2 -SSLv3 SSLHonorCipherOrder on SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS SSLCertificateFile "/private/etc/apache2/server.crt" SSLCertificateKeyFile "/private/etc/apache2/server.key" SSLCompression off # not always present Header always edit Set-Cookie […]

反向代理到内部服务器映射

我想为5个Web服务器设置一个反向代理。 反向代理接收到的所有请求都将在http请求查询string中具有唯一标识(UID)。 我有一个包含UID – > Web服务器映射的数据库。 我不确定这是否合理。 我想要反向代理执行以下操作:1.请求进来2.检查UID的caching,如果没有find从数据库加载它3.转发请求到适当的Web服务器 仅供参考 – 我无法将服务器ID编码到UID中,因为映射可能会更改,但uid不会。 像perlbal或其他工具是这样的可能吗? 我不介意如果我需要做一些脚本来做到这一点。 我只是不确定我的select是什么或者其他人做了什么来解决这个问题。 任何input是非常感谢!