The picture below describes the problem.
I have a proxy (nginx) that handles security.
I've changed localhost everywhere in jira's config to jira.mydomain.tld; no luck.