我的网络服务器上运行了几个webapp:
https://beta.mydomain.tld/svn/reposhttps://beta.mydomain.tld/trachttp://beta.mydomain.tld/端口8080上的本地Apache Tomcat的代理访问请注意,前两个可通过SSL获得,第三个不是(尚未).现在我需要通过https提供我的网络应用程序,但我希望Trac和SVN浏览器仍可在其当前位置访问.
即我想配置的Apache2代理所有请求没有开始svn或trac到Tomcat.
对于现有的SSL Web应用程序,有以下配置
<Location /svn/repos>
DAV svn
SVNParentPath /home/myuser/svn
SVNListParentPath on
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /home/myuser/.htpasswd
Require valid-user
</Location>
<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /home/myuser/trac
PythonOption TracUriRoot /trac
AuthType Basic
AuthName "Trac"
AuthUserFile /home/myuser/.htpasswd
Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)
我试图添加以下位置,但它没有任何帮助...
<Location />
ProxyPass http://localhost:8080
ProxyPassReverse http://localhost:8080/
</Location>
Run Code Online (Sandbox Code Playgroud)
有关更多信息,这里是关于SSL部分的完整apache2配置(没有任何我失败的试验 - 我认为它是默认的trac配置):
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName beta.mydomain.tld:443
DocumentRoot /var/www/
<Directory /var/www/>
Options Indexes …Run Code Online (Sandbox Code Playgroud) 我使用mod_proxy_balancer来管理后端服务器的故障转移.后端服务器可能会返回错误代码,而不是在某些其他后端服务失败时(例如NFS)超时,我们希望此类服务器也被标记为失败的节点.因此我们使用failonstatus指令.
<Proxy balancer://avatar>
ProxySet failonstatus=503
BalancerMember http://active/ retry=30
# the hot standby
BalancerMember http://standby/ status=+H retry=0
</Proxy>
Run Code Online (Sandbox Code Playgroud)
目前,故障转移与一个故障完美配合.当活动节点发生故障时,用户会收到503错误,并且从下一个请求中,备用服务器将接管.
我甚至不希望一个请求失败.无法将mod_proxy故障转移到客户端并返回错误?如果活动节点出现故障,我希望mod_proxy为同一个请求尝试待机,而不仅仅是后续请求!
我在我的Ubuntu 14.04中使用php-fpm 5.5.9配置Apache 2.4.9.我想要的是为php-fpm请求制作一个平衡器,但它会抛出以下错误:
AH01071: Got error 'Primary script unknown\n'
当我尝试访问我的PHP文件.似乎代理平衡器不会抓取ProxyPassMatch传递给它的文档根目录.我正在使用UDS使apache访问php-fpm套接字而不是使用网络tcp.
如果我配置它没有平衡器,一切正常.
ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php5-fpm.sock1|fcgi://./var/www/html
Run Code Online (Sandbox Code Playgroud)
ProxyPassMatch ^/(.*\.php(/.*)?)$ balancer://localhost/var/www/html
<Proxy balancer://localhost/>
BalancerMember unix:/var/run/php5-fpm.sock1|fcgi://localhost:9001
BalancerMember unix:/var/run/php5-fpm.sock2|fcgi://localhost:9002
BalancerMember unix:/var/run/php5-fpm.sock3|fcgi://localhost:9003
BalancerMember unix:/var/run/php5-fpm.sock4|fcgi://localhost:9004
</Proxy>
Run Code Online (Sandbox Code Playgroud)
这是平衡器的配置日志:
[Sun Jun 15 12:32:30.839726 2014] [authz_core:debug] [pid 12217:tid 140330025703168] mod_authz_core.c(828): [client 10.1.1.2:52526] AH01628: authorization result: granted (no directives)
[Sun Jun 15 12:32:30.839899 2014] [lbmethod_byrequests:debug] [pid 12217:tid 140330025703168] mod_lbmethod_byrequests.c(97): AH01207: proxy: Entering byrequests for BALANCER (balancer://localhost)
[Sun Jun 15 12:32:30.839915 2014] [lbmethod_byrequests:debug] [pid 12217:tid 140330025703168] mod_lbmethod_byrequests.c(144): AH01208: proxy: byrequests …Run Code Online (Sandbox Code Playgroud) 我目前尝试为某种彗星技术(长轮询XHR请求)实现一个简单的HTTP服务器.由于JavaScript对跨域请求非常严格,我有几个问题:
JavaScript的apache和我的彗星服务器运行之间进行交互在不同的端口上,由于一些跨域限制. - >不行!mod_proxy新的子域上映射我的服务器的想法.我真的不知道它是如何mod_proxy工作的,但我可以想象我知道我的第一种方法有同样的效果吗?什么是创建这种经典网站和这些长轮询XHR请求的这种组合的最佳方式?我是否需要在自己的服务器上实现内容交付?
我将Spring Security和Apache代理用于Web应用程序.使用标准mod_proxy时一切正常,但在切换到AJP代理后,Spring安全重定向出现问题.
Apache配置:
<VirtualHost *:80>
ServerName domain.com
ProxyPass / ajp://localhost:8009/Context/
ProxyPassReverse / ajp://localhost:8009/Context/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
当我打电话给http://domain.com/login时,我会看到一个登录表单.
当我提交表单时,我会访问http://domain.com/auth并获得身份验证.
然后Spring Security应重定向到http://domain.com/index,但它会重定向到http://domain.com/Context/index
我怎样才能摆脱那个上下文路径?为什么Spring Security会在任何地方添加它
在Spring Security网站上有一个类似的问题,但没有人回答:
http://forum.springsource.org/showthread.php?95141-Why-is-spring-security-including-the-context-path
PS谷歌没有发现任何与此问题有关的内容似乎很奇怪.我是唯一使用Spring Security + AJP的人吗?也许这是一个错误的模式?
解:
<VirtualHost *:80>
ServerName domain.com
RewriteEngine on
RewriteRule ^/Context/(.*)$ /$1 [R=301]
ProxyPass / ajp://localhost:8009/Context/
ProxyPassReverse / ajp://localhost:8009/Context/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud) 所以我使用Apache将特定文件夹代理到Glassfish实例.我的conf中的规则是:
ProxyPass /folder http://localhost:28083
ProxyPassReverse /folder http://localhost:28083
ProxyPassReverseCookiePath /folder http://localhost:28083
Run Code Online (Sandbox Code Playgroud)
它的工作正常,除了会话.对于每个子文件夹,都会创建一个新会话.
因此,当我留在一个文件夹中时,会话仍然存在,但是一旦我跳转到另一个文件夹,就会建立一个新的会话.
如何为所有子文件夹创建一个会话?
我们的Web服务器(配置为ssl - > apache - > jetty)随机拒绝带有400 Bad Request错误代码的多部分上传POST请求.apache错误日志(在信息级别)显示以下两个错误:
[info] [client x1.y1.z1.w1] (70007)The timeout specified has expired: SSL input filter read failed.
[error] proxy: pass request body failed to x.y.z.w:8087 from x1.y1.z1.w1
[info] [client x1.y1.z1.w1] Connection closed to child 74 with standard shutdown
Run Code Online (Sandbox Code Playgroud)
要么
[info] [client x2.y2.z2.w2] (70014)End of file found: SSL input filter read failed.
[error] proxy: pass request body failed to x.y.z.w:8087 from x2.y2.z2.w2
[info] [client x2.y2.z2.w2] Connection closed to child 209 with standard shutdown
Run Code Online (Sandbox Code Playgroud)
这两种情况都是客户端在400 Bad Request中产生的.有时我们的jetty服务器甚至没有看到请求意味着它在apaches端被拒绝,有时它开始处理它只是被拒绝(这在我们的UploadFilter中表现为MultipartException) …
我有一个应用程序,要求我在反向代理中禁用缓冲.我设法使用以下nginx配置:
server {
listen 80;
server_name 10.0.0.104;
location / {
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://http_backend;
proxy_redirect default;
}
}
upstream http_backend {
server 10.0.0.86:8080;
keepalive 16;
}
Run Code Online (Sandbox Code Playgroud)
我需要在Apache上使用相同的设置,但apache没有proxy_buffering off指令.我能够在mod_proxy文档中找到的唯一配置是ProxyIOBufferSize,ProxyReceiveBufferSize但它们具有最小值而不是禁用缓冲的选项.我测试了那些,但我的应用程序失败了.
我想安装"libapache2-mod-proxy-html"包,但是当我想安装它时,它给了我错误.只是为了检查可用的包是什么,我在下面的第一个命令中按下了标签.
devadmin@Dev-LinuxVM:/$ aptitude install -y libapache2-mod-proxy-
Run Code Online (Sandbox Code Playgroud)
libapache2-mod-proxy-msrpc libapache2-mod-proxy-uwsgi-dbg libapache2-mod-proxy-uwsgi
devadmin@Dev-LinuxVM:/$ aptitude install -y libapache2-mod-proxy-html
Run Code Online (Sandbox Code Playgroud)
找不到任何名称或描述与"libapache2-mod-proxy-html"相匹配的包找不到任何名称或描述匹配的包"libapache2-mod-proxy-html"不会安装,升级或删除任何包.0个包升级,0个新安装,0个删除,0个未升级.需要获得0 B的档案.打开包装后,将使用0 B.
我正在使用Ubuntu 16.04.1 LTS(xenial)
我正在尝试使用wordpress设置反向代理并排除几个路径.我的排除规则适用于admin,includes,.. etc,但它不适用于/ wp-json /.我怀疑是因为.htaccess.我需要wordpress来返回其余的api数据,因为我在gatsbyjs中使用它.
我花了一整天的时间试图解决这个问题.出于某种原因,我的setup/wp-json /返回404,它被代理到我网站的前端部分所在的netlify服务器.如果我删除所有代理规则wp-json的工作原理.
.htaccess包含默认的wordpress内容.
这是我的虚拟主机的pastebin:https: //pastebin.com/vFh6hCkN
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive …Run Code Online (Sandbox Code Playgroud)