Overriding the "Host" header for redirects

PaperCut's web server requires the ability to redirect users to new pages. When performing a redirect, the target location is based on the Host header that the web browser requested. If the host header is omitted (e.g. by manually crafting an HTTP request), the target location is based on the server's own hostname or IP address. In a NAT environment this may not be ideal if the server's IP address is considered private.

This may also apply if security audit software reports Web Server HTTP Header Internal IP Disclosure or similar.

To configure PaperCut to always forward to a specified host:

  1. Open [app-path]/server/server.properties in a text editor.

  2. Add a new line:

    server.force-host-header=printing.uni.edu

    where printing.uni.edu is the fully qualified host name that all users will access PaperCut on.

  3. Restart the service PaperCut Application Server

  4. Test access to the web interface (using both HTTP and HTTPS if applicable).

Note that when this option is used, PaperCut should not be accessed using any hostname other than the one configured. Doing so may cause problems.