publicServerUrl property
Public URL used by browsers to send requests to the server.
This value only needs to be set if using a reverse proxy on a non-standard port (i.e. not port 80 for HTTP or not port 443 for HTTPS), that forwards requests to the server for processing.
If not using reverse proxy, this value should be set to the empty string.
When a request arrives that matches a directory, and the requested URL did not end with a slash, the response is a HTTP redirection that adds a slash to the URL. This is necessary, because otherwise relative links in the returned document (either a generated directory listing or the contents of a default file from that directory) will not resolve properly. If a proxy is being used, the redirection URL must be for the proxy rather than the actual server, otherwise the browser will not be able to get to the new URL. This member contains the URL exposed by the proxy.
For example, consider a server running on port 10000, which has been deployed behind a reverse proxy running on port 8080. The browser visits http://example.com:8080/foo/bar, and the reverse proxy forwards a request for "/foo/bar" to port 10000. The server find a directory called "bar" and would normally respond with a HTTP redirect to "/foo/bar/" (adding the extra slash). But in this situation, the browser would attempt to retrieve http://example.com/foo/bar/ which will fail (since the reverse proxy is on port 8080). The value of this member needs to be set to "http://example.com:8080" so that the HTTP redirect will be to "http://example.com:8080/foo/bar/".
Implementation
String publicServerUrl;