My FNZ Studio Version

System Installation & Upgrade

Latest Update: 26.02.2025 |
Documentation
2024
2023
2022.2
2022.1

Introduction

FNZ Studio usually runs behind a load balancer, a web application firewall, and other kinds of proxy servers. Each of these in-between systems may make changes to an incoming HTTP request. However, many features of FNZ Studio rely on accurate information about the original request sent by the user.

Terminology note: This document uses the term proxy server to refer to any kind of network device used to process and potentially modify incoming HTTP requests along the way to an application server hosting FNZ Studio. This includes load balancers and web application firewalls.

HTTP Headers

If a proxy server makes changes to a request when forwarding it internally, this proxy server must use a set of HTTP headers to remember details about the original request. This covers the following information:

  • Public client IP address
  • Protocol (HTTP or HTTPS)
  • Host
  • Port

Different features of FNZ Studio depend on receiving accurate information about the original request. The public client IP address can be used for auditing and other security purposes. Protocol, host, and port are needed when generating URLs which will allow a user to reach this system, for example for links in emails or for redirect URLs in an OIDC authentication flow.

The headers used to store this information are the following:

  • X-Forwarded-For — A comma-separated list of IP addresses, starting with the original client IP address, and followed by the IP address of every proxy server.
  • X-Forwarded-Proto — The protocol used by the client ("http" or "https").
  • X-Forwarded-Host — The original host name as received as HTTP header Host.
  • X-Forwarded-Port — The original TCP port.

Configuration

This section describes how to configure proxy servers and Tomcat so that FNZ Studio has access to the details of the original HTTP request sent by the user.

Proxy Servers

For security reasons, special attention is to be given to the configuration of the first trusted proxy server.

First Trusted Proxy Server

The first trusted proxy server is the outermost device at the boundary from an untrusted network (usually the public internet) to the trusted internal network.

If an incoming request contains any of the HTTP headers listed above, they must be removed from the request.
In other words, the above headers must be set only by trusted proxy servers. If these headers are present in a request received from an untrusted system, they must be discarded.

All Proxy Servers

The following rules apply to all trusted proxy servers.

  • Client IP address
    Every proxy server should append the client IP address to the header X-Forwarded-For. If the header does not yet exist, it is added to the request. Note that this is not the proxy server's own IP address. This is the IP address of the TCP client from which the proxy server has received the request.

  • Protocol
    If the proxy server is changing the protocol (e.g., from HTTPS to HTTP), and if the request does not already contain a header X-Forwarded-Proto, it must be added to the request. The value is the original protocol (either "http" or "https") with which the proxy server has received the request.

  • Host
    If the proxy server is changing the Host header of a request, and if the request does not already contain a header X-Forwarded-Host, it must be added to the request. The value is the value of the original Host header present in the request when it was received by the proxy server.

  • Port
    If the proxy server is forwarding the request to a custom port which is different from the port it has received the request on, and if the original port is also different from the standard port for the original protocol (80 for HTTP and 443 for HTTPS), and if the request does not already contain a header X-Forwarded-Port, it must be added to the request. The value is the original port.
    Handling of port changes can be more complex. There can be additional network devices which can change the port at TCP level through features like port forwards or NAT. Whether or not the header X-Forwarded-Port must be set depends on additional factors. Best case, all systems will always use the default port for the protocol in use (80 for HTTP and 443 for HTTPS). In this case, the header X-Forwarded-Port should not be needed since the port can be inferred from the protocol.

Note that it is valid for the first proxy server to always set all these headers unconditionally. This means that the configuration of subsequent proxy servers can be simplified as they only have to care about logging the client IP in header X-Forwarded-For.

Example

A user sends a request to https://my-bank.com. The request is received by a load balancer and forwarded internally to http://eb-node-02.mybank.internal:3000, one of multiple application servers hosting FNZ Studio.

Here is the data from the original request:

  • Client IP: Public IP address of client
  • Protocol: HTTPS
  • Host: my-bank.com
  • Port: 443 (standard port for HTTPS)

If the application server checks the details of the incoming request, it will see the following data:

  • Client IP: Internal IP address of load balancer
  • Protocol: HTTP
  • Host: eb-node-02.mybank.internal
  • Port: 3000

In order for FNZ Studio to know the details of the original request, the load balancer should set the following headers in the request:

  • X-Forwarded-For: {Original public client IP address}
  • X-Forwarded-Proto: https
  • X-Forwarded-Host: my-bank.com
  • X-Forwarded-Port: 443 (optional, default port for HTTPS)

Tomcat

FNZ Studio does not process these headers itself. Instead, it relies to the Java application server to map the values of these headers to properties of the HttpServletRequest object defined the Servlet API.

For Tomcat, this mapping is usually done using the RemoteIpValve. With the valve's default configuration, the headers X-Forwarded-For and X-Forwarded-Proto are already mapped. But support for the headers X-Forwarded-Host and X-Forwarded-Port must be enabled explicitly.

Example

The following configuration can be added to Tomcat's server.xml or context.xml file:

<!-- map HTTP headers set by proxy servers to HTTP request properties -->
<Valve className="org.apache.catalina.valves.RemoteIpValve"
       hostHeader="X-Forwarded-Host"
       portHeader="X-Forwarded-Port"
/>
© 2026 Appway AG. All Rights Reserved