Today I’ve been fighting again with how to get GetFeatureInfo working in my Geoserver, Apache, Tomcat environment. It’s pretty simple actually: One needs a proxy which I put in
Proxy code can be found in
OpenLayers-2.9/examples/proxy.cgi (Download the full package of OpenLayers and use it instead of the package that ships with Geoserver). Add all necessary hosts to allowedHosts list.
Don’t forget to set it executable:
sudo chmod +x /usr/lib/cgi-bin/proxy.cgi
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";