我有nginx代理到一个应用程序服务器,具有以下configuration: location /app/ { # send to app server without the /app qualifier rewrite /app/(.*)$ /$1 break; proxy_set_header Host $http_host; proxy_pass http://localhost:9001; proxy_redirect http://localhost:9001 http://localhost:9000; } 对/ app的任何请求都会转到:9001,而默认网站托pipe在:9000。 GET请求正常工作。 但是每当我提交一个POST请求到/ app / any / post / url,它会导致一个404错误。 通过GET / app / any / post / url直接在浏览器中直接点击url,按预期的方式点击app服务器。 我在网上find了类似问题的其他人,并添加了 proxy_set_header Host $http_host; 但这并没有解决我的问题。 没有logging错误,访问日志如下: # For http://localhost:9000 […]
前言: 我已经configuration了一个具有多个虚拟主机的公共访问服务器 一个虚拟主机的请求需要发送到后端服务器。 所有其他请求都需要在本地进行。 问题: 一旦需要代理的网站被启用,所有虚拟主机的请求将被传递到ProxyPass指令中指定的IP地址。 当我尝试访问任何其他虚拟主机时,我从代理网站上获取网页。 禁用代理网站时,所有其他虚拟主机恢复正常操作并在本地进行服务。 configuration: 我在虚拟主机可公开访问的服务器上的configuration:(其他虚拟主机是同一个configuration的副本) <VirtualHost *:80> ServerName www.mainsite.com ServerAlias mainsite.com ServerAdmin [email protected] DirectoryIndex index.php DocumentRoot /var/www/mainsite.com <Directory /> AllowOverride None </Directory> LogLevel info ErrorLog /var/log/mainsite.com_err.log CustomLog /var/log/mainsite.com_access.log combined </VirtualHost> 我在可公开访问的虚拟主机上进行代理的configuration: <VirtualHost *:80> ServerName calendar.othersite.com ServerAdmin [email protected] ProxyRequests Off <Location /> ProxyPass http://192.168.0.1/ ProxyPassReverse http://192.168.0.1/ </Location> <Proxy> Order Allow,Deny Allow […]
我正在尝试使用Apache在我的服务器上本地运行的Cloud9实例设置反向代理。 我有以下设置: <VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://localhost:3131/ ProxyPassReverse / http://localhost:3131/ ServerAdmin [email protected] ServerName cloud9.mydomain.org </VirtualHost> 我也尝试重新sorting的指令,所以ServerAdmin和ServerName第一。 到目前为止,如果我点击http://cloud9.mydomain.org ,我得到一个浏览器错误,说它无法连接。 Apache的access.log或error.log中也没有logging。 我在想,我错过了一些作品,但是我不确定这个作品可能是什么。 我也不知道我是否在正确的地方寻找原木。 Cloud9进程已启动,似乎在3131端口上运行。 我不打算开放Cloud9。 我所拍摄的最终游戏是最终通过SSL使用一些authentication(也许是基本authentication)来获取Cloud9,但是在开始添加SSL和authentication之前,我想到了,我应该先让基础知识工作。 更新 apachectl -S输出: # apachectl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server www.mydomain.org (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost www.mydomain.org (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost […]
(为了简单起见,我将Apache服务器的IP改为1.1.1.1,将Gollum服务器改为6.6.6.6) 我试图通过Apache服务于Gollum wiki,因为它已经正确设置了SSL,而且我目前只在testingGollum wiki。 所以我把Apache设置为ProxyPass(config下面)。 问题是机架服务器似乎工作正常,当我直接从我的代理机器通过curl访问它: 1.1.1.1 – – [05/Dec/2013 06:20:25] "GET /docs/Home HTTP/1.1" 200 6467 0.2135 但是每当我尝试使用我的浏览器时,我都会得到一个404。 Rackup说: 6.6.6.6 – – [05/Dec/2013 06:20:00] "GET /docs/Home HTTP/1.1" 404 – 0.0006 荒谬的是,当我使用与我的浏览器通过代理服务器(1.1.1.1)的telnet发送(如下所示)完全相同的标题时,请求成功: 6.6.6.6 – – [05/Dec/2013 06:19:19] "GET /docs/Home HTTP/1.1" 200 6467 0.2759 我不知道我在做什么错,为什么(以及如何?!)机架区分来自同一台机器的两个不同的请求。 请帮助? (在ruby 1.9.2p320,RHEL 6上,在RHEL 5和Rack 1.2(Release:1.5)上使用Apache / 2.2.15) 编辑显然,这是WEBrick的问题,因为当我切换到薄它的工作。 还是会喜欢你的见解… Apacheconfiguration: <VirtualHost […]
我试图build立一个与Apache的反向代理,并在大多数情况下,它与ProxyPass很好地工作。 我想排除我能理解的一个目录! 指标,logging在这里: http : //httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassreverse 所以我有: ProxyPass /examples ! ProxyPass / http://localhost:3000/ 这工作正常,如果我去/examples存在的/examples的文件,但如果我打一个地址,导致404错误,请求获取代理,而不仅仅是404返回。 我宁愿404返回。 在文档中我看不到任何东西 – 有谁知道它是如何完成的? 非常感谢! 这是与Apache v2.4.6。
我想在nginx后面运行squid服务器。 我的示例configuration: location ~* ^/get/(.*) { proxy_pass http://ip:3128; proxy_set_header Host evenstatichostnamefortest.com; proxy_set_header Request-URI http://evenstatichostnamefortest.com/samplefile.zip; proxy_redirect off; } 输出: http://server.com/get/www.google.com 鱿鱼错误: 尝试检索URL时遇到以下错误:/ get / www.google.com 无效的url 所有我想要的是基于文件夹传递请求(例如mysite / get / videourl到youtube / videourl和mysite / dl /文件名到我的下载服务),但我想知道为什么我甚至不能覆盖Request-URI和主机静态值 任何帮助,将不胜感激
我经常使用Apache使用ProxyPass和ProxyPassReverse将代理服务器反向代理到其他服务器。 我一直在做这个顶级文件夹。 但现在我有要求将网站的主页放在新的CMS服务器上。 反向代理主页的最佳方式是什么(对于请求:GET / HTTP / 1.1),而不影响每个请求? 我想我可以列出服务器上的每个目录和顶级页面! 指示。 但是肯定有更好的办法。 所有的帮助感激地收到。
我需要代理将多个段进一步传递给另一个服务器,最多可以有两个5段。 nginx需要匹配什么 example.com/somehash example.com/somehash/segment1 example.com/somehash/segment1/segment2 example.com/somehash/segment1/segment2/segment3 example.com/somehash/segment1/segment2/segment3/segment4 example.com/somehash/segment1/segment2/segment3/segment4/segment5 现在,代码如下,只匹配 example.com/somehash example.com/somehash/segment1 为此,我们有这样的代码块: location ~* ^/([a-z0-9]+)/?$ { proxy_pass http://@tds/direct/$1?$args; proxy_set_header Referer $http_referer; proxy_set_header X-Original-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_redirect off; } location ~* ^/([a-z0-9]+)/([A-Za-zА-Яа-я0-9\-\_\[\]\{\}\.]+)/?$ { proxy_pass http://@tds/direct/$1/$2?$args; proxy_set_header Referer $http_referer; proxy_set_header X-Original-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header […]
我有nginxconfiguration为代理请求: server { listen 80; server_name proxy.mydomain.com; location /proxy { resolver 8.8.8.8; proxy_pass $args/; } } 所以我可以提出这样的要求: http : //proxy.mydomain.com/proxy?http : //www.test.com 我想控制哪个域允许被代理。 如果没有,我不知道该怎么做。
在我的应用程序中,我正在做一些标准的场景,其中Java Web应用程序部署在带有Apache代理的JBoss上。 Web应用程序可以从/ esp的上下文访问,所以直接的url将是(但我已经closures了HTTP的Jboss,只有AJP): http://1.2.3.4:8080/esp 现在,我已经创build了子域,并尝试通过Apache根上下文的代理移动。 所以我想要Apache代理: https://mysubdomain.domain.com -> ajp -> Jboss /esp context app 我相信我错过了我的configuration明显的东西,只有根应用程序的上下文是可访问的,其余的url已经弄糟上下文以404结束。例如,请求代理是这样的: https://mysubdomain.domain.com/css/somecss.css -> ajp -> /esp/esp/css/somecss.css Apacheconfiguration看起来像这样: <VirtualHost 1.2.3.4:80> ServerName mysubdomain.domain.com RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L] </VirtualHost> <IfModule mod_ssl.c> <VirtualHost 1.2.3.4:443> ServerName mysubdomain.domain.com ProxyPass / ajp://localhost:8009/esp/ ProxyPassReverse / ajp://localhost:8009/esp/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> […]