问题
I have a new rasperryPi webserver running raspbian that I'm trying to use to proxy to web-enabled device from FieldServer Tech (fieldserver.com) on our intranet. Inside /etc/apache2/sites-available/default I've added the following line:
<Location /modbus/>
ProxyPass http://192.168.10.124/
</Location>
After restarting the webserver when I try to browse to the defined proxy address
http://192.168.10.7/modbus/
I get the password prompt from the FieldServer device but after authenticating I get an error indicating the initial page cannot be loaded:
Not Found
The requested URL /app/profiles/profiles.htm was not found on this server.
Apache/2.2.22 (Debian) Server at 192.168.10.7 Port 80
Is there a way I can address this problem from the apache conf or is the problem with the FieldServer device?
More system info:
$ cat /etc/os-release*
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
$ dpkg-query -l | grep apache
ii apache2 2.2.22-13+deb7u3
回答1:
I believe you need to add the ProxyPassReverse directive to the apache configuration:
<Location /modbus/>
ProxyPass http://192.168.10.124/
ProxyPassReverse http://192.168.10.124/
</Location>
This answer has a pretty concise explanation on what ProxyPassReverse does, if you're curious.
来源:https://stackoverflow.com/questions/26455199/proxypass-failing