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/