Hi,
When the JIRA base URL points to the PROXY URL… how to get the JIRA url for TOMCAT/App server instead of the proxy?
Thanks,
Pablo.
Hi,
When the JIRA base URL points to the PROXY URL… how to get the JIRA url for TOMCAT/App server instead of the proxy?
Thanks,
Pablo.
Have you tried injecting the com.atlassian.sal.api.web.context.HttpContext into your service/object? From there you can get the HttpRequest object which would let you recreate the url by looking at the getServerName and getServerPort.
Well, I took the HttpContext attached to the LocalThread which I think it works similarly to any other alternative like the mentioned SAL api, etc. But they return the remote user’s browser URL. That is just the problem.
Many companies use a proxy to forward those calls to the JIRA/Tomcat server on a different host which does not have configured the proxy host name, so the URL raises a 404 error.
Example:
Well, it is easy to resolve by including myproxy into the /etc/host file in the myhost server. But it has some drawbacks:
So the perfect solution would be get the https://myhost/jira URL from the plugin itself.
There are other good arguments for that like performance: it is better whether the plugin invokes JIRA directly rather than took an indirect way trough the proxy.
I’ll try this. Perhaps my guess is false and the HttpRequest via SAL API returns a different value than the one provided by the JIRA API for the getServerName method. I’ll back with the results…
Another item to take a look at is to take a look at the Host header on the http request. In theory if the proxy does it’s thing properly (huge if) - that should be returning the proxying http request’s host (not the original requests).