Apache LocationMatch:内部重定向后如何再次匹配
我有一个Apache Location -Match,上面有两组重新写入和重写。如果第二套命中率,我想重新启动LoactionMatch。
在我的apache2(apache/2.4.41(ubuntu)mod_wsgi/4.9.0 python/3.8配置)config i有这样的东西:
<LocationMatch ^/incoming-request$>
RewriteEngine On
RewriteCond /tmp/test-file -f
RewriteRule (.*) /some/service [QSA,L]
RewriteCond /file-associated-with-the-request -f
RewriteRule (.*) /myapp [L]
</LocationMatch>
where myapp
是一个生成/tmp的wsgi脚本/test-file
and返回301重定向
and 位置:/incoming-request
/file-file-cassiation-with-with-the-request
总是存在。
到目前为止,一切都很好。
如果/tmp/test-File
不存在,则触发/myApp
,然后生成/tmp/test-file
。然后,我希望location -match
再次重新开始,以便/some/service
在第一个循环之后,存在为/tmp/test-file
触发。这不会发生。
如果我curl http:// localhost/incoming-request
我获得了/tmp/test-file
生成的,我从/myApp 。因此,如果我想从
/某些/服务
获得返回,则必须再次运行卷发。
有没有办法在location -match
中再次循环循环,所以我不必两次执行我的请求?
I have a apache LocationMatch with two sets of RewriteCond and RewriteRule. If the second set hits I want to start the LoactionMatch over again.
In my apache2 ( Apache/2.4.41 (Ubuntu) mod_wsgi/4.9.0 Python/3.8 configured) config I have something like this:
<LocationMatch ^/incoming-requestgt;
RewriteEngine On
RewriteCond /tmp/test-file -f
RewriteRule (.*) /some/service [QSA,L]
RewriteCond /file-associated-with-the-request -f
RewriteRule (.*) /myapp [L]
</LocationMatch>
Where myapp
is a wsgi script which generates the /tmp/test-file
and returns 301 redirect
and Location: /incoming-request
/file-associated-with-the-request
always exists.
So far so good.
If the /tmp/test-file
does not exists then trigger the /myapp
which then generates the /tmp/test-file
. Then I want the LocationMatch
to start over again so that the /some/service
is triggered as /tmp/test-file
exists after the first loop. This does not happen.
If I curl http://localhost/incoming-request
I get the /tmp/test-file
generated, and I get the return from /myapp
. So if I want to get the return from /some/service
I have to run the curl again.
Is there a way to kind of loop over again in the LocationMatch
so I dont have to do my request twice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论