You are here: Administration > Server management > Override the "Host" header for redirects

Override 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 might not be ideal if the server's IP address is considered private.

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

Configure PaperCut to always forward to a specified host

  1. In a text editor, open [app-path]/server/server.properties.

    Add a new line:

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

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

  2. Restart the service PaperCut Application ServerAn Application Server is the primary server program responsible for providing the PaperCut user interface, storing data, and providing services to users. PaperCut uses the Application Server to manage user and account information, manage printers, calculate print costs, provide a web browser interface to administrators and end users, and much more.

  3. 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 can cause problems.