我在CentOS上使用Apache 2.2.15为TomCat应用程序提供SSL。 ProxyPass / http://127.0.0.1:8090/ connectiontimeout=300 timeout=300 ProxyPassReverse / http://127.0.0.1:8090 这工作正常,一切都很好, 但是,我想添加以下行: Redirect permanent /broken/page.html https://www.servername.com/correct/page.html 在上面处理TomCat应用程序本身的错误之前。 然而,它似乎没有按照我所期望的方式工作(即它看起来什么都不做,也没有改变)。 这样可以使用redirect吗? 我不能编辑应用程序,不幸的是。
更新:我添加了一个修改后的问题后,下面两个答案。 你好, 如果你正在阅读,你可能对Apache的mod_proxy及其ProxyPass函数很熟悉。 像其他许多人一样,我有一个可以从内部networking外部访问的应用程序的问题,但是应用程序本身可以访问不同计算机上的其他内部应用程序,并且当您使用此设置进行远程访问时,情况会变得糟糕透顶。 所以,我的设置很简单,我有: 机器#1启用了远程访问,我通过主机名访问它,并且吐出运行在其上的PHP应用程序。 机器#2是一个运行Django的新应用程序,它使用了一个完全不同的后端(甚至authentication),它被托pipe在一个单独的机器上。 在我们的内部网中,我们通过一个简单的命名主机名来访问它,它主要链接到内部的192.168.0.101 ip。 我尝试使用ProxyPass来设置它,例如,传递给/ new将把它发送到新的应用程序: ProxyPass /新http://192.168.0.101/ 这种工作,它获取到其他应用程序的请求,但它打破了,因为我的Django应用程序想redirect到/ auth / login /,它立即无法识别。 如果我自己修改url为foo.net/new/auth/login我得到我的login页面,但是正如你所猜测的,在整个浏览过程中这样做是不方便的。 那么我怎样才能让ProxyPass按照我的意愿工作呢? 我是否需要对Apache做些什么,所以它总是写入/新的URL在其他应用程序之前,或者这是我应该在我的Django应用程序中修改? 任何提示和指针,以及将不胜感激。 谢谢你的时间
我试图让ProxyPass在我的OpenSUSE 13.1安装上工作。 我努力了: a2enmod proxy a2enmod proxy_http a2enmod proxy_connect systemctl restart apache2 systemctl reload apache2 (所有组合的陈述无济于事)。 我一直得到相同的错误: SERVER:/etc/apache2 # apache2ctl start -f /etc/apache2/httpd-proxy.conf AH00526: Syntax error on line 4 of /etc/apache2/httpd-proxy.conf: Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration httpd-proxy.conf看起来像: <VirtualHost *:80> DocumentRoot /srv/www/subsite ServerName www.site.com/subsite ProxyPass […]
我试图configuration一个Nginx服务器,通过一个UNIX域套接字连接到一个Node.js HTTP服务器。 Nginxconfiguration文件: server { listen 80; location / { proxy_pass http://unix:/tmp/app.socket:/; } } (根据http://wiki.nginx.org/HttpProxyModule#proxy_pass ) Node.js脚本: var http = require('http'); http.createServer(function(req, res) { console.log('received request'); req.end('received request\n'); }).listen('/tmp/app.socket'); 现在,当我尝试打电话 curl http://localhost/ 我只有curl中的502 Bad Gateway错误页面,Node.js进程没有任何内容。 我做错了什么? 编辑: 在尝试了quanta的解决scheme后,错误必须与Nginxconfiguration有关,因为Node.js进程正确地build立了与套接字的连接。 我也尝试过这样configurationNginx: upstream myapp { server unix:/tmp/app.socket; } server { listen 80; location / { proxy_pass http://myapp; } […]
为了使用Apache将stream量传递到端口80上的JBoss / TomCat,我们使用它来安装和configurationmod_jk 。 有没有相当于nginx? 基本上要所有的端口80stream量传递给JBoss。
我试图让这两个位置指令在Nginx中工作,但是我在启动Nginx时遇到了一些错误。 location ~ ^/smx/(test|production) { proxy_pass http://localhost:8181/cxf; } location ~ ^/es/(test|production) { proxy_pass http://localhost:9200/; } 这是我收到的错误: nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block 这听起来很熟悉吗? 我在这里错过了什么?
我在http://example.com/有一个正在运行的Web应用程序,并且希望在http://example.com/另一台服务器上“挂载”另一个应用程序。 上游服务器和proxy_pass似乎工作,但有一个问题: upstream luscious { server lixxxx.members.linode.com:9001; } server { root /var/www/example.com/current/public/; server_name example.com; location /en { proxy_pass http://luscious; } } 打开example.com/en ,我的上游应用程序返回404 not found /en 。 这是有道理的,因为上游没有path/en 。 proxy_path是正确的解决scheme吗? 我应该重写“上游”,所以它听/en而不是,因为它的根path? 还是有一个指令,允许我重写通往上游的path?
我想通过非SSL站点代理来自SSL站点的请求。 我的Apache httpd.conf看起来像这样: <VirtualHost 1.2.3.4:80> ServerName foo.com ProxyPass / https://bar.com/ </VirtualHost> 所以,当我访问http://foo.com时 ,我希望apache向https://bar.com发出请求,并向我发送它提取的页面。 相反,我得到一个500错误,并在错误日志中,我看到: [error] proxy: HTTPS: failed to enable ssl support for 4.3.2.1:443 (bar.com) 大概我在这里错过了一个指令。 这可能是什么? 没关系安全影响。 我完全理解风险。