Skip to main content
Skip table of contents

Reverse Proxy

HTTP Headers

To allow for the use of the application behind a reverse proxy the following headers must be sent in requests:

Header Name

Description

  • Host

The name of the server the request was sent to

  • X-Real-IP

The IP of the client making requests to the application

  • X-Forwarded-For

A comma separated list of all clients previously passed through when making the request

  • X-Forwarded-Proto

The protocol that was used to connect to the proxy (HTTP or HTTPS)

This will have to be configured in the reverse proxy itself, no configuration in the application is required.

An example of how this can be done in nginx is shown below:

CODE
location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

It is possible view the HTTP request headers that are being received by the application via the Administrator UI. To navigate to this page first click on “Debug Views”:

4770b93b-b283-4e8c-964c-6d5b7195f0d2.png

Then on the provided list of functions select “Show request headers”:

e353459a-0487-4632-aeb8-700169393ffb.png

The application will then show a list of the HTTP request headers and their values that were received by the application.

Server context path

If the application is configured to use a context path in the URL, it is strongly advised that the reverse proxy is configured to forward requests using the same value. If this is not done then depending on the server configuration the application may not resolve correctly.

For example if the application’s conf.yml is configured as follows:

CODE
server:
  servlet:
    contextPath: '/api'

Then the reverse proxy is configured to forward request to the application using the ‘/api’ path. For the above example the NGINX configuration needs to be adjusted as follows:

CODE
location /api {
                proxy_pass http://127.0.0.1:8080/api;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.