I have this setting in my apache, this work fine, but in my app when a get remote address this return local IP (127.0.0.1), how I solve this problem?
</Location>
</VirtualHost><VirtualHost *:80>
ServerName yourapp.yourdomain.com
ServerAlias yourapp.*
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /webapp http://localhost:8080/webapp
ProxyPassReverse /webapp http://localhost:8080/webapp
<Location /webapp>
Order allow,deny
Allow from all
</Location>
</VirtualHost>
You can use Remote_IP_Valve to set the actual IP address in the request.
In your tomcat/conf/server.xml add the valve like
<Valve className="org.apache.catalina.valves.RemoteIpValve"
remoteIpHeader="x-forwarded-for"
/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.