How does a servlet running on tomcat behind a proxy know about the server name to which the browser send the request

StackOverflow https://stackoverflow.com/questions/21241805

Question

I have the following arrangment: Browser -> forward proxy-> cloud -> (apache server + jira web app). For experimental purposes, I go to the forward proxy with a domain name fwdproxy.foo.com and then forward proxy changes it to jira.foo.com and forward the connection. When I jira page gets loaded, I get the error "JIRA is reporting that it is running on the hostname 'jira.foo.com', which does not match the hostname used to run these diagnostics, 'fwdproxy.foo.com '. This is known to cause JIRA to construct URLs using the incorrect hostname, which will result in errors in the dashboard, among other issues.

On further debugging I see this com.atlassian.gadgets.dashboard.internal.diagnostics.UrlHostnameMismatchException: Detected URL hostname, 'jira.foo.com', does not match expected hostname fwdproxy.foo.com.

How did jira web app get to know what hostname the browser was using. Since the forward proxy create a completely different http connection, jira should not have got to know what the browser did behind the forward proxy. Please provide inputs.Thanks

Était-ce utile?

La solution

Just 2 ideas :
You can configure JIRA, giving him the public url (Administration / Global configuration / base url)
I suppose JIRA compare this field with the HOST http header, or use antoher mechanism, an XSS protection, perhaps the atlassian.xsrf.token ?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top