0

I have GeoServer 2.18.2 hosted on tomcat 9.

http://xx.xx.xx.xx:8080/geoserver/web

With the IP it is working perfectly fine.

To use it within OpenLayers I was needed it behind SSL. So through proxypass I have hosted it in apache2 to give it a domain name. Below are the configurations

<VirtualHost *:80>
    ServerName geoserver.example.com
    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy /geoserver>
        Order deny,allow 
        Allow from all 
    </Proxy>
    ProxyPass /geoserver http://127.0.0.1:8080/geoserver
    ProxyPassReverse /geoserver http://127.0.0.1:8080/geoserver
RewriteEngine on
RewriteCond %{SERVER_NAME} =geoserver.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

https://geoserver.example.com/geoserver/web/ Now I can access the layers in OpenLayers and login into admin successfully but when I click on navigation and use search and save other settings it gives me 400 Bad Request Error.

Apparently, it seems like there is an issue in proxy pass configurations because when I use it along with port 8080 it works prefectly. But I needed this way along with SSL https://geoserver.example.com/geoserver/web/

enter image description here

5
  • Did you set up the proxy in global settings?
    – Ian Turton
    Commented Mar 1, 2021 at 19:03
  • Do you mean proxy base URL? If so Yes I tried that one too and gave this URL geoserver.example.com but no success.
    – Awais Khan
    Commented Mar 2, 2021 at 7:10
  • @IanTurton I have been trying these but no success. I don't know I did it correctly or not. Can you please tell me should I use geoserver.example.com in my case or IP with the port?
    – Awais Khan
    Commented Mar 2, 2021 at 8:47
  • assuming that "geoserver.example.com" is your service's name then use that, also make sure you have https in the proxy base url
    – Ian Turton
    Commented Mar 2, 2021 at 8:50

0

Browse other questions tagged or ask your own question.