简体   繁体   English

php apache - 反向代理双斜杠

[英]php apache - reverse proxy double slash

I have problem with leading double double slash when I use apache reverse proxy. 当我使用apache反向代理时,我遇到导致双双斜杠的问题。 ($_SERVER['REQUEST_URI'] always starts with //, except when I access directly root. ($ _SERVER ['REQUEST_URI']总是以//开头,除非我直接访问root。

Configuration 组态

ProxyPass /admin/ http://admin.example.com/
ProxyPassReverse /admin/ http://admin.example.com/

or

<Location /admin>
   ProxyPass http://admin.example.com/
   ProxyPassReverse http://admin.example.com/
</Location>

I've tried all possible combinations like 我尝试过所有可能的组合

but no luck. 但没有运气。 Did I miss something? 我错过了什么?

Ok, after more experimenting, this works: 好的,经过更多的实验,这有效:

<Location /admin>
    ProxyPass http://admin.example.com
    ProxyPassReverse http://admin.example.com
</Location>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM