-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix geoserver not configured properly behind proxy #106
Fix geoserver not configured properly behind proxy #106
Conversation
…rick As suggested here https://serverfault.com/questions/177273/set-up-http-proxy-for-tomcat-web-server and here https://memorynotfound.com/configure-http-proxy-settings-java/ using setenv.sh trick from https://github.com/kartoza/docker-geoserver/tree/2.9.4#setting-tomcat-properties Trying to fixing this problem: Hitting directly geoserver http://pavics.ouranos.ca:8087/geoserver/wfs?request=GetCapabilities&version=1.1.0 (only works inside Ouranos firewall), I am getting proper ``` <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get xlink:href="http://pavics.ouranos.ca:8087/geoserver/wfs"/> <ows:Post xlink:href="http://pavics.ouranos.ca:8087/geoserver/wfs"/> </ows:HTTP> </ows:DCP> ``` Behind Nginx proxy https://pavics.ouranos.ca/geoserver/wfs?request=GetCapabilities&version=1.1.0, we end up with the wrong http protocol and the wrong port ``` <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get xlink:href="http://pavics.ouranos.ca:80/geoserver/wfs"/> <ows:Post xlink:href="http://pavics.ouranos.ca:80/geoserver/wfs"/> </ows:HTTP> </ows:DCP> ```
…rking fix Rollback fddbd1e. Trying to fixing this problem: Hitting directly geoserver http://pavics.ouranos.ca:8087/geoserver/wfs?request=GetCapabilities&version=1.1.0 (only works inside Ouranos firewall), I am getting proper ``` <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get xlink:href="http://pavics.ouranos.ca:8087/geoserver/wfs"/> <ows:Post xlink:href="http://pavics.ouranos.ca:8087/geoserver/wfs"/> </ows:HTTP> </ows:DCP> ``` Behind Nginx proxy https://pavics.ouranos.ca/geoserver/wfs?request=GetCapabilities&version=1.1.0, we end up with the wrong http protocol and the wrong port ``` <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get xlink:href="http://pavics.ouranos.ca:80/geoserver/wfs"/> <ows:Post xlink:href="http://pavics.ouranos.ca:80/geoserver/wfs"/> </ows:HTTP> </ows:DCP> ``` With this fix: Behind Nginx proxy https://lvupavics.ouranos.ca/geoserver/wfs?request=GetCapabilities&version=1.1.0 we get ``` <ows:Operation name="GetCapabilities"> <ows:DCP> <ows:HTTP> <ows:Get xlink:href="https://lvupavics.ouranos.ca:443/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavics.ouranos.ca:443/geoserver/wfs"/> </ows:HTTP> </ows:DCP> ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve the spirit of it, but cannot really comment on the actual content ; )
FYI @f-PLT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow understand this! And also it looks good to me.
Great! I'll pass this information along on our side. |
Adding @matprov as well. If CRIM instances have autodeploy enabled, there is nothing to do on your side, you'll just get it automatically. |
Sorry maybe I need to explain in simple terms what I did for everyone else as well. I had to override the docker image entrypoint to edit the |
@tlvu Yes our staging has just been updated with this change, so prod will be updated tonight, thanks to autodeploy! |
Restore this fix: #106, adapt to new entrypoint. Tested setting env var `HTTPS_PROXY_NAME: ${PAVICS_FQDN_PUBLIC}`, as in https://github.com/kartoza/docker-geoserver/blob/b3239c32da009dca57e15ffdb5c3f3a465184466/scripts/start.sh#L186-L188, did not work. Test: ``` $ curl --silent "https://lvupavicsmaster.ouranos.ca/geoserver/wfs?request=GetCapabilities&version=1.1.0" | xmllint --format - |grep lvupavicsmaster <wfs:WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ows="http://www.opengis.net/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inspire_dls="http://inspire.ec.europa.eu/schemas/inspire_dls/1.0" xmlns:inspire_common="http://inspire.ec.europa.eu/schemas/common/1.0" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs https://lvupavicsmaster.ouranos.ca/geoserver/schemas/wfs/1.1.0/wfs.xsd http://inspire.ec.europa.eu/schemas/inspire_dls/1.0 http://inspire.ec.europa.eu/schemas/inspire_dls/1.0/inspire_dls.xsd" updateSequence="0"> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Get xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> <ows:Post xlink:href="https://lvupavicsmaster.ouranos.ca/geoserver/wfs"/> ```
Hitting https://pavics.ouranos.ca/geoserver/wfs?request=GetCapabilities&version=1.1.0
Before fix (wrong scheme and wrong port):
After fix:
This config automate manual step to set proxy base url in Geoserver UI https://docs.geoserver.org/2.9.3/user/configuration/globalsettings.html#proxy-base-url
I had to override the docker image entrypoint to edit the
server.xml
on the fly before starting Geoserver (Tomcat) since setting Java proxy config did not seem to work (see first commit).Related to Ouranosinc/raven#297.
Edit:
server.xml
on the fly before starting Geoserver (Tomcat) since setting Java proxy config did not seem to work (see first commit)."