我试图使用nginx作为两个weblogic服务器的代理服务器。 weblogic上的端口是23823和23824,我希望它们都可以从端口8888访问,并通过上下文path进行区分。 我试过这个configuration: listen 8888; server_name vead03; location /app1 { proxy_pass http://127.0.0.1:23823; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /app2 { proxy_pass http://127.0.0.1:23824; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } 我可以通过端口8888访问这两个服务器没有问题,但是当一个请求登陆服务器,我打电话给request.getServerPort() ,我收到80由于某种原因。 我不知道这个消息从哪里来。 80端口不在nginxconfiguration中,我绝对没有在Weblogic的任何地方使用它。 这是一个相当大的问题,因为应用程序预计会收到8888 ,而不是80。
我正在运行lighttpd 1.4.33,它是从互联网开放的Apache服务器反向代理的。 当从lighttpd服务器的本地地址访问脚本时,GETparameter passing给脚本就好了,我得到了预期的结果。 但是,当通过代理访问脚本(并由以下lighttpd规则重写)时,查询参数似乎完全被删除。 似乎是导致问题的重写规则: $HTTP["host"] =~ "^site\.example\.com$" { # This affects the requests that aren't rewritten below, ie. static stuff server.document-root = "/var/www/example/public" url.rewrite-once = ( "^((?!assets).)*$" => "index.php/$1" ) } 这应该是重写所有URL,以便它们通过index.php中的路由引擎传递,除了/assets目录中的静态内容(静态内容)。 请注意, /assets是/var/www/example/public的子目录,所以这个工作正常。 Lighttpd用下拉参数debugging请求的日志: 2014-07-23 11:36:46: (response.c.310) Request-URI : /foo/bar?someparam=data 2014-07-23 11:36:46: (response.c.311) URI-scheme : http 2014-07-23 11:36:46: (response.c.312) URI-authority: site.example.com 2014-07-23 […]
鉴于以下虚拟主机: <VirtualHost *:80> DocumentRoot "/var/www/dashboards/public/dist" Servername local.dashboards ServerAlias local.dashboards Header add Access-Control-Allow-Origin: "*" Header add Access-Control-Allow-Methods: "POST, GET, OPTIONS, PUT, DELETE, HEAD" Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept, Authorization" Alias /api /var/www/dashboards/laravel/public <Directory "/var/www/dashboards/public/dist"> Options MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Directory "/var/www/dashboards/laravel/public"> Options MultiViews FollowSymLinks AllowOverride All Order allow,deny […]
我有一个Tomcat服务器(JIRA)在Apache反向代理服务器后面工作(需要一段时间,但是我到了那里)。 我正在升级我的旧服务器,并添加Apache给我一些额外的function和安全性。 旧的服务器被访问 https://example.com:8443 我希望能够让Apache转发任何使用端口8443访问旧地址的人(即从旧书签等)到https://example.com但我正在努力使其工作。 我可以做以下 http://example.com – > https://example.com http://example.com:8443 – > https://example.com 但https://example.com:8443在Chrome中生成SSL连接错误。 我有点卡住了 在httpd.conf中有 Listen 80 Listen 8443 在httpd-vhosts.conf中有 <VirtualHost *:80> ServerName example.com Redirect / https://example.com/ </VirtualHost> <VirtualHost *:8443> ServerName example.com Redirect / https://example.com/ </VirtualHost> 在httpd-ssl.com我有 Listen 443 <VirtualHost *:443> ServerName example.com SSLEngine On SSLCertificateFile "C:\Program Files\Atlassian\JIRA\jre\server.crt" SSLCertificateKeyFile "C:\Program Files\Atlassian\JIRA\jre\server.key" SSLProxyEngine Off […]
我有一个网站http://someplace.acme.com ,我希望我的用户通过访问http://myplace.mycorp.com – 非常标准的反向代理设置。 特殊要求:任何js文件 – 要么由.js扩展名和/或MIMEtypes(如果可能的话)标识文本/ JavaScript需要从一个不同的位置,一个本地工具,检查js的潜在威胁。 所以我有 location / { proxy_pass http://someplace.acme.com; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location ~* \.(js)$ { proxy_pass http://127.0.0.1:8188/filter?source=$1; proxy_redirect off; proxy_buffering off; } JS仍然是从远程服务,我不知道如何检查MIMEtypes。 我错过了什么?
(见下面的编辑) 我有nginx转发请求到Apache 2.4,我得到127.0.0.1作为SERVER_ADDR的值。 正确的IP仅在HTTP_X_SERVER_ADDRESS上可用。 我已经安装了rpaf模块,但它只修复了REMOTE_ADDR值(以前也是127.0.0.1,现在是正确的远程IP)。 有没有办法在SERVER_ADDR上获得正确的服务器IP? 我在nginx.conf中有以下configuration: proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Server-Address $server_addr; proxy_set_header Host $host; 编辑 :我只是意识到,我可以使用proxy_pass [my-server-ip]而不是proxy_pass 127.0.0.1 ,有没有什么缺点呢?
我看到了proxy_cache_valid指令,但是让我困惑。 在HTTP中,上游服务器不是用Cache-Control和maxage ? 如何获得Nginx的caching来使用maxage ?
我正在使用Windows Server 2008 R2上的IIS 7.5运行一个小网站。 我有一个node.js应用程序也运行在端口3000上。 来自网站(客户端浏览器)的HTTP调用反向代理http://example.com/node/whatever到http://localhost:3000/whatever 。 一切工作到目前为止。 问题是当我尝试使用socket.io。 我收到: WebSocket connection to 'ws://example.com/socket.io/?EIO=3&transport=websocket&sid=adb9WRpoMFYRoS0vAAAB' failed: Error during WebSocket handshake: Unexpected response code: 502 我很确定,如果我没有错,那就是: 它将最初的请求转发给我的服务器,因为对websocket服务器的初始请求是一个标准的HTTP请求(带有一些额外的头文件)。 IIS确实知道,只是转发请求。 然而,一旦接收到websocket请求,websocket服务器发送101响应并切换到websocket模式。 IIS不理解websocketstream量,并且无法代理该stream量。 有没有一个技巧或解决scheme来configuration反向代理的ws://地址?
我有安装了反向代理的Jenkins和Apache httpd 。 它们安装在同一台PC上。 我可以直接访问Jenkins,没关系。 例如下面的链接工作正常: http://127.0.0.1:8080/jenkins/manage : http://127.0.0.1:8080/jenkins/manage : http://127.0.0.1:8080/jenkins/manage 其他网页看起来不错,如果我试图通过jenkins直接访问它们。 我也可以通过SSL通过Apache访问Jenkins: https://127.0.0.1/jenkins/manage : https://127.0.0.1/jenkins/manage 。 没事。 但是当我在这个页面上按«pipe理插件»,我被redirect到以下URL http://127.0.0.1/jenkins/pluginManager/ ,它已经是纯HTTP。 我收到“未find”错误页面。 当我在Apache SSL的configuration页面https://127.0.0.1/jenkins/configure上按“保存”时,获得类似的错误。 我也redirect到普通的HTTP http://127.0.0.1/jenkins/ 。 可能这种从SSL切换到纯HTTP的情况只会发生在POST请求上,但我不能百分百的确信。 在testing期间,我根据https://wiki.jenkins-ci.org/display/JENKINS/Disable+securityclosures安全 与Jenkins相关的Apacheconfiguration指令如下: Listen 443 ProxyPass /jenkins http://127.0.0.1:8080/jenkins nocanon ProxyPassReverse /jenkins http://127.0.0.1:8080/jenkins ProxyPreserveHost On ProxyRequests Off <Proxy http://127.0.0.1:8080/jenkins*> SSLRequireSSL RequestHeader set X_FORWARDED_PROTO 'https' Order deny,allow Allow from all […]
我已经将Apache2前端作为反向代理configuration运行多年了。 我无法改变的是后端服务器在短时间内closures后的行为(即重新启动) 在重新检查后端是否回来之前,Apache将继续传送代理错误页面很长一段时间。 我需要手动重新启动每一次,我可以理解用户已经annoyed。 我怎么能告诉Apache不记得“破”代理后端,但每次重试? 如果这是不可能的,我怎样才能configuration时间阿帕奇“caching错误”很短,可以说10秒。 我正在谈论非常简单的标准反向代理configuration或多或less像这样: ProxyPass /site http://10.1.1.8/backend ProxyPassReverse /site http://10.1.1.8/backend