Changeset 1698:7e4396e467de in digilib (mirror)


Ignore:
Timestamp:
Dec 18, 2018 11:35:41 AM (3 months ago)
Author:
Robert Casties <casties@…>
Branch:
default
message:
37369036
Message:

Add documentation about running Tomcat behind a proxy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/src/site/markdown/server-setup.md

    r1681 r1698  
    7272    # do not forward-proxy!
    7373    ProxyRequests off
    74     # set proxy proto header
     74    # set proxy headers
     75    ProxyPreserveHost On
    7576    RequestHeader set X-Forwarded-Proto "https"
    7677    # digilib instances
     
    9798correct request URL for the servlets.
    9899
    99 Please see [this information for Jetty 9.4](http://www.eclipse.org/jetty/documentation/9.4.x/configuring-connectors.html#_proxy_load_balancer_connection_configuration) or [this information for Jetty 8 and earlier versions](https://wiki.eclipse.org/Jetty/Tutorial/Apache#Configuring_mod_proxy_http).
     100Please see [this information for Jetty 9.4](http://www.eclipse.org/jetty/documentation/9.4.x/configuring-connectors.html#_proxy_load_balancer_connection_configuration)
     101or [this information for Jetty 8 and earlier versions](https://wiki.eclipse.org/Jetty/Tutorial/Apache#Configuring_mod_proxy_http).
     102
     103## Tomcat behind a proxy
     104
     105When you are using [Tomcat](https://tomcat.apache.org) as a servlet container behind an Apache or nginx proxy then
     106you should make sure that Tomcat processes the `X-Forwarded-*` headers from the proxy server to derive the
     107correct request URL for the servlets.
     108
     109Please see the Tomcat documentation about the [Remote IP Valve](https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Remote_IP_Valve).
     110You basically need to add the following XML tag with your proxy's IP numbers to the `Host` tag of your `server.xml` file:
     111```
     112  <Valve className="org.apache.catalina.valves.RemoteIpValve"
     113    internalProxies="127\.0\.0\.1|123\.45\.67\.89"
     114    remoteIpHeader="x-forwarded-for"
     115    proxiesHeader="x-forwarded-by"
     116    protocolHeader="x-forwarded-proto" />
     117```
     118and make sure `ProxyPreserveHost` is set to `on`.
Note: See TracChangeset for help on using the changeset viewer.