Score:0

Run GeoServer behind HTTPS using IIS

it flag

I have GeoServer 2.23.2 running under Tomcat 9.0.78 on Windows Server 2022. http://localhost:8080/geoserver/ and https://localhost:8443/geoserver/ URL's are working properly. But I couldn't find the right settings for https://subdomain.mydomain.com/geoserver/. When I try to access this site, it says "ERR_CONNECTION_TIMED_OUT"

IIS Settings: In IIS 10, a Wildcard certificate like

*.mydomain.com

is added to Server certificates. In HTTP Response Header, CORS is enabled with

Access-Control-Allow-Origin "*"

I use IIS Aplication Request Routing and proxy is enabled. In URL Re-Write, Match Url is

(geoserver/.*)

and Rewrite URL is

http://localhost:8080/{R:0}

which refers to Tomcat.

Tomcat Server.xml Settings:

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
           maxParameterCount="1000"
           />
.....

<Connector port="8443" protocol="HTTP/1.1"
           maxThreads="150"
           SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLS"
           clientAuth="false"
           maxParameterCount="1000"
           keystoreFile="${catalina.home}/conf/star_mydomain.jks" /* the same certificate in IIS */
           keystorePass="password"
           keystoreType="JKS"
           URIEncoding="UTF-8"
           />

tomcat9\webapps\geoserver\WEB-INF\web.xml settings:

<context-param>
        <param-name>GEOSERVER_CSRF_WHITELIST</param-name>
        <param-value>mydomain.com,*.mydomain.com,localhost:8080,localhost:8443</param-value>
      </context-param>

****

    <filter>
      <filter-name>cross-origin</filter-name>
      <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
      <init-param>
        <param-name>cors.allowed.origins</param-name>
        <param-value>*</param-value>
      </init-param>
      <init-param>
        <param-name>cors.allowed.methods</param-name>
        <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
      </init-param>
      <init-param>
        <param-name>cors.allowed.headers</param-name>
        <param-value>*</param-value>
      </init-param>
    </filter>

****

    <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

And finally on GeoServer global configuration, when I add proxy base URL as https://subdomain.mydomain.com/geoserver/ and click to save button, URL redirects to https://subdomain.mydomain/geoserver/j_spring_security_check and it says "ERR_CONNECTION_TIMED_OUT". Therefore, I cannot login to GeoServer.

I'm missing something but can not see.

PS: Server is not connected to the internet yet. After successful deploy, it will connect.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.