我怎样才能从nginx写这个代理pass示例: 代码一: location /appDir/ { proxy_pass https://Name/appDir/; } haproxy? 另外:下面是来自haproxy网站。 代码二: # ProxyPass /mirror/foo/ http://bk.dom.com/bar http-request set-header Host bk.dom.com reqirep ^([^ :]*)\ /mirror/foo/(.*) \1\ /\2 但是从注释部分开始吧?
我有一些在其他服务器上运行的服务,它们在没有SSL的http:// someLocalIp:80上提供了一个web应用程序。 我想在SSL中包装这个,并在https:// nginxServer-globalIp / deliver / 我能够看到像这样的后端服务,但这显然会中断所有链接和引用,因为现在“/ deliver /”必须是前缀。 我不明白如何去使用重写,因为重写似乎(对我)主要是用来改变请求,而不是从后端回复。 这是可能吗? 🙂 当前configuration: server { listen 443; ssl on; ssl_certificate /etc/ssl/some.crt; ssl_certificate_key /etc/some.key; location /deliver { proxy_pass http://someLocalIp; } } 我已经尝试在proxy_pass的末尾添加/(尽可能多的答案build议),但是这会创build一个空白的响应,就好像后端服务没有向nginx发送任何东西。 另外,改变后端以匹配“/ deliver”前缀并不像听起来那么容易,所以我希望没有这样做就可以做到这一点。
我有一个专用的服务器: Ubuntu 14.04.3 BIND 9.9.5-3ubuntu0.5-Ubuntu(扩展支持版本) Nginx版本1.9.6在端口81 使用Zend OPcache v7.0.6-dev的PHP 5.5.30(cli) MySQL 5.5.45 UFW启用 我的网站:Drupal 7 一切正常。 但每次我连接到psiphon3代理(防filter),我在Chrome浏览器上得到“ERR_EMPTY_RESPONSE”: No data received ERR_EMPTY_RESPONSE Unable to load the webpage because the server sent no data. 注意:其他网站,如drupal.org回应。 我检查了系统日志,Nginx和绑定日志,但没有任何帮助。 也许这是因为DNSconfiguration(绑定)或Nginx的,我不知道我的服务器configuration是什么问题。 如果需要更多的服务configuration细节,我可以提供。 当人们使用代理时,我需要网站做出回应。
我运行一个Apache服务器的Wildfly 8服务器。 我们需要大量的search选项。 如果你search的东西,你可以select许多checkbox。 通常每个请求都将被执行。 但是如果只有一个选项没有被选中,我们创build一个大的URL。 我们在Apacheconfiguration中添加了2个选项。 LimitRequestLine 100000 LimitRequestFieldsize 100000 现在我们跑了一个极限。 如果URL长度超过8000个字符,那么Apache不会发生错误,但URL会被截断。 Apache日志文件仅保存截断的URL。 如果我直接在Wildfly上运行相同的进程,它就可以工作。 如果我通过proxypass使用Wildfly和Apache2,是否需要其他configuration? ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/
我有一个域,我有一个通配符logging到IP(61.61.61.61)(不在我的控制之下)。 因为我希望域中的某些页面在我的控制之下,所以我认为通过nginx代理所有数据是很容易的。 但看起来这是不一样的行为。 相反,当我尝试加载之前正确显示的网站的主索引时,它现在将我redirect到另一个网站。 我认为这是因为nginx不是代理所有的数据或不转发某些头。 我这样configurationnginx server { server_name test.com; root /var/www/test.com/; index index.html index.htm index.php; merge_slashes on; location /landers { if (!-e $request_filename) { rewrite ^.*$ /index.php last; } } location / { proxy_pass http://61.61.61.61:80; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; # edit below to fix config display fastcgi_param […]
我想问下面的configuration有什么区别。 应用程序的原始URL /位置: http:// localhost:8080 / MyServerApp / App_1 第一次设置/configuration ProxyPreserveHost On ProxyPass /app http://localhost:8080/MyServerApp/App_1 retry=0 ProxyPassReverse /app http://localhost:8080/MyServerApp/App_1 第二次设置/configuration <Location /app > ProxyPass http://localhost:8080/MyServerApp/App_1 ProxyPassReverse http://localhost:8080/MyServerApp/App_1 </Location>
我有一个像下面的location块 location ^api/([^/]+)(/.+)$ { set $my_host $1; set $my_path $2; proxy_pass http://$myhost$my_path$is_args$args; } 对于大多数正常情况下,如/api/foo/bar?1234 。 但是,当我介绍特殊的URL编码值,南下。 当URI是/api/foo/bar[%7B%7D] , $my_path被解码,并作为/foo/bar[{}]传递给$my_host 。 这不是一个有效的url。 我试图通过使用条件来匹配$request_uri和$uri来解决NGINX的限制,但是结果要么是双重编码的,要么是未编码的。 location ~* ^api/([^/]+)(/.+)$ { set $my_host $1; if ( $request_uri ~* ^api/([^/]+)(/.+)$ ) { set $my_path $2; } proxy_pass http://$myhost$my_path$is_args$args; } 在上面的例子中, $my_path是/foo/bar[%257B%257D] 。 我也尝试使用第二个正则expression式的set misc模块中的set_unescape_uri 。 我怎样才能让NGINX以与客户端提供的格式相同的格式删除path组件?
前言:尝试安装JXCore的Plesk的节点扩展,我不能得到它的工作。 给我一些错误,他们的支持不回答电子邮件…… [IP地址] =真实IP,example.com =真实域 无论如何,我有我的nodejs应用程序启动并运行一个SSL证书。 如果我去https://example.com:3000 ,这是我用于节点的端口工作正常。 SSL证书加载所有绿色,一切都很好。 我正在使用Plesk 12.5,并且已经安装了Nginx。 .conf文件位于/var/www/vhosts/[domain]/conf/nginx.conf。 在顶部它说: #DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, #SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED. 他们不是在开玩笑。 对这个文件做任何改变几乎立即被覆盖。 这里是整个文件内容: server { listen [IP ADDRESS]:443 ssl; server_name example.com; server_name www.example.com; server_name ipv4.example.com; ssl_certificate /usr/local/psa/var/certificates/cert-HREdQ9; ssl_certificate_key […]
我有一个apache 2.4服务器,它使用proxypass将一个域的SSL连接转发到同一本地networking上的OSX服务器5.1.5。 我生成我的CSR在Apache服务器上,它似乎工作,但抛出一个networking错误,当使用设备注册,抱怨一个无效的SSLconfiguration,我可以点击注册和下载configuration文件,但后来我得到 configuration文件configuration失败 – networking错误 以下是我的虚拟主机configuration。 <VirtualHost *:443> ServerName mydomain.xyz SSLEngine On SSLProxyEngine On ProxyRequests Off SSLProxyCheckPeerCN off SSLProxyCheckPeerExpire off SSLProxyCheckPeerName off SSLInsecureRenegotiation on SSLProxyVerify none SSLVerifyClient none SSLCertificateFile /etc/ssl/mydomain_xyz.crt SSLCertificateKeyFile /etc/ssl/mydomain_xyz.key ProxyPass / https://10.0.1.36/ ProxyPassReverse / https://10.0.1.36/ ProxyPreserveHost on <Location "/"> Require all granted </Location> </VirtualHost> 在浏览器中访问域时,我看不到任何错误。 我的configuration有任何可能的错误吗? 第二台服务器有一个自签名证书,因为它不直接处理任何外部连接,只能通过Apache服务器上的proxypass。 这是用proxypass设置SSL的正确方法,还是应该为使用CSR的第二台服务器创buildSSL证书?
我一直在为一个NGINX代理进行A / Btesting。 这个盒子有一个虚拟主机,用来保存企业网站,另外我添加了另外一个虚拟主机,可以将传入的stream量redirect到一个多站点的后端。 当访问者在URL的末尾添加“/ es /”时,应该被redirect到一个WordPress后端。 唯一的办法,我发现这样做,是使用“返回301 http://en.wp.example.com/ ”,但它覆盖域和所有站点链接指向wordpress。 所以这是错的。 使用proxy_pass指令看起来是最好的select,但我发现我的wordpressconfiguration和连接到数据库(我得到“错误build立数据库连接”)的麻烦,我一直想找出问题留在哪里,它在“Header $ host”指令上。 server { listen 80; server_name www.stg.example.com; location /en/ { proxy_pass http://en.wp.stg.example.com/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; } 我想覆盖的地址,并避免链接的URLredirect,但是当我尝试使用这种格式,一些图像显示中断。 一个想法是将主机头设置为“www.stg.example.com”,但是它自动redirect到这个相同的虚拟主机,给我一个空的页面。 我需要在URL的末尾添加/ en /并使用www.stg.example.com伪装WP后端地址。 任何想法?