我最终的目标是使用现有的Apache2服务器来反向我们的开发服务器的代理,也映射到防火墙后面的vm主机的Web UI。 我可以得到代理加载单个服务器的页面,并为群集(使用不同的configurationW /平衡器),但我不能得到的path被重写。 我已经直接从如何正确处理相关的URL与一个反向代理没有成功复制一些例子。 我正在尝试将https://dev.ourdomain.com/proxmox映射到https://10.2.7.101:8006 。 ProxyPass /proxmox/ https://10.2.7.101:8006/ ProxyPassReverse /proxmox/ https://10.2.7.101:8006/ ProxyHTMLURLMap https://10.2.7.101:8006 /proxmox/ <Location /proxmox/> ProxyPassReverse / SetOutputFilter proxy-html ProxyHTMLURLMap https://10.2.7.101:8006 /proxmox/ ProxyHTMLURLMap / /proxmox/ ProxyHTMLURLMap /proxmox/ /proxmox/ RequestHeader unset Accept-Encoding </Location> 有人能指出我的(可能是显而易见的)错误吗? 先谢谢你
我有Nginx运行作为一个Web服务器的代理,我想保护访问使用TLS / SSL客户端证书。 这是我的SSLconfiguration server { listen 443 ssl; server_name www.domain.com; ssl_certificate /etc/nginx/ssl/domain/server.crt; ssl_certificate_key /etc/nginx/ssl/domain/server.key; ssl_client_certificate /etc/nginx/ssl/clients/client_ca.pem ssl_verify_client on; 它工作得很好 – 但现在我需要允许访问我的网站没有来自一个特定IP地址的客户端证书。 有没有可能性与nginx做到这一点? 谢谢 :-)
我有一个Django应用程序与postgres后端,我configurationgunicorn后面的nginx作为反向代理工作。 我的机器运行Ubuntu 14.04。 一切似乎都奏效了,除非我尝试login到我的应用程序时遇到了一个令人讨厌的错误: DatabaseError在/ login / inputinettypes的input语法无效:“”LINE 1:… 00101 Firefox / 41.0','2015-12-12 09:39:55.590036 + 00:00','') exception位置:/home/mhb11/.virtualenvs/redditpk/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py执行中,第54行 请注意,如果我单独使用Gunicorn,这个错误永远不会出现! 你能帮我解决这个问题吗? 我有几个念头: 1) inet数据types接受IPv4和IPv6主机和networking(但不包括域名)。 也许我应该改变我在/ etc / nginx / sites-available / myproject中使用的域名? 但我试过了; 我的网站根本无法加载(迄今为止它只在我尝试login后才失败)。 / etc / nginx / sites-available / myproject中的代码粘贴在下面。 2)不同的理论是这样的: 当我尝试login时,我的代码尝试添加一行到空的远程IP的日志表。 当我使用反向代理时,代码可能不知道远程IP,因为它被代理的IP所遮蔽。 由于它是空的,有可能代码试图忽略代理的IP,但没有find更好的。 因此,它应该使用X-Forwarded-For头 。 如果没有合理的IPlogging,程序应该简单地logging“NULL”作为IP。 为此,我在/ etc / nginx / sites-available / myproject中join了proxy_params […]
我在我们公司的本地分公司运行一个Tomcat 7服务器。 服务器通过端口80和443公开。前几天,总部pipe理员更改了configuration。 Tomcat现在需要通过反向代理连接。 总部pipe理员更改了防火墙规则,更改了DNS条目并configuration了反向代理。 由于他们没有使用tomcat的经验,他们要求我改变configuration,让Tomcat在8080上收听来自反向代理的请求。 Tomcat的连接器定义如下: <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" /> <Connector protocol="HTTP/1.1" port="443" maxThreads="400" scheme="https" secure="true" SSLEnabled="true" keystoreFile="foobar.jks" keystorePass="foo_bar" clientAuth="false" sslProtocol="TLS"/> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" proxyName="server.company.com" proxyPort="443" /> 但是,当我从Firefox调用URI时,出现“redirect错误”,说明存在无法完成的redirect。 在Tomcats访问日志中,有以下模式的条目: <revere proxy internal ip> – – [14/Dec/2015:15:52:31 +0100] "GET / HTTP/1.1" 302 – 如果我删除了proxyName和proxyPort连接器属性,则会发送一个redirect到tomcat的内部服务器名称。 任何帮助解决这个问题表示赞赏。
我有两个Web应用程序http:// app1:8080和http:// app2:3000在两个不同的端口和不同的机器上运行。 我必须通过Apache Web服务器http:// myapp传递应用程序stream量。 现在,我们可以通过将应用程序挂载到特定的位置来将apache web服务器configuration为反向代理。 例如, ProxyPass /app1/ http://app1:8080/ ProxyPass /app2/ http://app2:3000/ ProxyPassReverse /app1/ http://app1:8080/ ProxyPassReverse /app2/ http://app2:3000/ 在映射之后, http:// myapp / app1指向http:// app1:8080 , http:// myapp / app2指向http:// app2:3000 。 但是,我的要求是http:// myapp:8080应指向http:// app1:8080和http:// myapp:3000应该指向http:// app2:3000 。 请指导我如何在Apache Web服务器端口的基础上反向代理stream量。
我现在所拥有的是几个由子域标识的虚拟主机,然后像这样代理服务器: <VirtualHost *:80> ProxyPass / http://192.168.1.1/ ProxyPassReverse / http://192.168.1.1/ ServerName sub1.example.com </VirtualHost> <VirtualHost *:80> ProxyPass / http://192.168.1.2/ ProxyPassReverse / http://192.168.1.2/ ServerName sub2.example.com </VirtualHost> 我想要的是Apache基于example.com/sub1,example.com/sub2等进行代理。 没有什么我已经尝试过似乎和子域一样工作。 我尝试过使用Alias指令,位置块等,但它不断重写URL到我的浏览器,当然不能到达后端机器。 这怎么能正确地做到?
我试图在NGINX中使用proxy_pass设置一个反向代理。 页面加载正常,但所有使用相对URL的静态辅助(js,css,imgs)都会因为它预先安装父服务器的主机名而中断。 有没有办法使用反向代理,同时维护所有静态资源的代理主机名? parent.conf server { listen 80; server_name parent.mydomain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name parent.mydomain.com; root /var/www/parent; index index.html; try_files $uri.html $uri $uri/ =404; # error and access out error_log /var/log/error.log; access_log /var/log/access.log; ssl on; ssl_certificate /etc/ssl/myssl.pem; ssl_certificate_key /etc/ssl/myssl-key.pem; # Here is the important part. Any url matching # […]
如果我使用的是Amazon的Elastic Load Balancer for Rails应用程序,那么是否需要在应用程序和ELB之间放置一个Nginx反向代理?
我有一个Django的应用程序,它有nginx作为一个反向代理与gunicorn作为一个应用程序的Web服务器(上游)。 在我的nginx虚拟主机文件的location /块中,我指的是Web应用程序服务器中的unix套接字,如下所示: if (!-f $request_filename) { proxy_pass http://application_server; break; } 想法是不需要得到gunicorn服务静态资产,nginx应该照顾他们。 我有两个相关的问题:1)性能明智,有这样的types检查nginx可能是昂贵的。 你有没有看到你的经验? 我的networking应用程序是一个高stream量的社交论坛和大量的静态资产需要服务。 想法,做和不(如果有的话)? 需要更多信息? 2)很好的certificate, 如果在nginx的情况下是邪恶的。 如何用try_files更改if指令? 我自己开了一枪。 它看起来很直接。 但是每次都会坠毁和烧毁。 这是我的尝试: 用try_files $uri @application_server;replace整个if指令try_files $uri @application_server; 在location /下包含location @application_server块; 这包含proxy_pass http://application server 。 在configuration文件的顶部有一个upstream application_server块(外部server ),它包含了对unix socket的引用, fail_timout=0; 。 应该有效,不是吗? 如果您需要,请询问更多信息。
代理服务器在同一端口上绑定多个主机名时, upstream不起作用。 我在尝试configurationnginx(1.9.12-1〜trusty)到proxy_pass Windows Server 2012主机时遇到了这个问题。 我已经在我自己的Windows 10机器上复制了相同的行为。 在下面的configuration中,所有主机名都指向相同的机器IP。 有时需要工作 注意:我是在selectlocalhost:7778时候进行代理的。 http { upstream w { server test1:80; server test2:80; server localhost:7778; } server { listen 8001; server_name localhost; location / { proxy_pass http://w; } } } 请求没有工作的时间 注意:如Alexey指出的那样编辑。 http { upstream w { server test1:80; server test2:80; # server localhost:7778; } server { listen […]