I have setup a Geoserver on Ubuntu 22.04. For safety, I run it as https with a let’s encrypt certificate. The server is a remote VPS machine. Geoserver is 2.25.1.
Geoserver is up and running. Geoserver delivers sample content to QGIS, connecting with https://…/geoserver/tiger/wms (for example)
However, logging in as admin is impossible because the authorisation connects by http.
I get Mixed Content: The page at ‘https://…/geoserver/web/?6’ was loaded over a secure connection, but contains a form that targets an insecure endpoint ‘http://…/geoserver/j_spring_security_check’. This endpoint should be made available over a secure connection.
I can login as admin through locally, with remote desktop, but this is very impractical. I want to avoid remote login for simple maintenance tasks.
Replyng to myself because it might help other users.
Quite by chance, I found the solution in an old Stackoverflow thread.
- Go to the geoserver directory inside /geoserver/webapps/geoserver/WEB-INF
- Open the web.xml file inside web-inf for editing
- Uncomment the below tag and edit the value to your server main url as below.
4. <context-param>
<param-name>PROXY_BASE_URL</param-name>
<param-value>https://XXXXX.XXXXXXXXXX.XXXX/geoserver</param-value>
</context-param>
- Save the file, restart Geoserver and admin login works.
There are a number of ways to set the proxy base url “application property”.
The system admin can define using:
- Environmental varaible
- Java System Property
- Web application context as you discovered.
Or the GeoServer admin can define use global settings page.
For more information see user manual.
1 Like