Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php apache - reverse proxy double slash

Tags:

php

apache

I have problem with leading double double slash when I use apache reverse proxy. ($_SERVER['REQUEST_URI'] always starts with //, except when I access directly 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

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

but no luck. Did I miss something?

like image 961
Zdenek Machek Avatar asked Nov 20 '25 12:11

Zdenek Machek


1 Answers

Ok, after more experimenting, this works:

<Location /admin>
    ProxyPass http://admin.example.com
    ProxyPassReverse http://admin.example.com
</Location>
like image 117
Zdenek Machek Avatar answered Nov 23 '25 02:11

Zdenek Machek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!