GeoServer setup redirect

Hi, I am trying to setup a domainname for GeoServer.

This is the domainname: https://geoserver.domainname.nl/geoserver

In the web.xml file within \webapps\geoserver\WEB-INF i have set up the following:

<context-param>
	<param-name>PROXY_BASE_URL</param-name>
	<param-value>https://geoserver.domainname.nl/geoserver</param-value>
</context-param>

When i open this link i see this:
503 Service Unavailable
No server is available to handle this request.

Am i doing this correct and/or is there any other way to set this up?

Thank you.

There are several ways to set it up, are you using the binary distribution or installing a war into Tomcat?

GeoServer checks PROXY_BASE_URL value from three locations, before checking configuration.

  1. Java System Property

    -DPROXY_BASE_URL=https://geoserver.domainname.nl/geoserver
    
  2. Web Application Context

    • Configuring your application server, for Tomcat this is done by editing conf/Catalina/localhost/geoserver.xml:

      <Context docBase="geoserver.war">
        <Parameter name="PROXY_BASE_URL"
                   value="https://geoserver.domainname.nl/geoserver"/>
      </Context>
      
    • Unzipping the geoserver.war and editing the web.xml (not recommended as you lose your setting when updating).

      <context-param>
        <param-name> PROXY_BASE_URL </param-name>
        <param-value>https://geoserver.domainname.nl/geoserver</param-value>
      </context-param>
      
  3. Environmental variable

    export PROXY_BASE_URL=https://geoserver.domainname.nl/geoserver
    
  4. Administration console Settings > Global (stored as part of geoserver configuration).

For more information please read Setting Application Property. It uses the example of GEOSERVER_DATA_DIR, but the same approach works for PROXY_BASE_URL.

Other tips:

Thank you for the helpful insight! I was using the war file. I got it all working now so you can close the topic. Thanks for the speedy reply!