Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug - localhost hardcoded in jira

Alexandru Lungu March 9, 2020

This is related to https://community.atlassian.com/t5/Jira-questions/Some-of-jira-links-point-to-localhost/qaq-p/1317799#M412573

I have uninstalled jira and installed it again fresh. Changed all "localhost" config references but it seems that they are hardcoded.

 

WhatsApp Image 2020-03-09 at 14.11.11 - Copy.jpeg

 

Can I get a version that is known to work ok?

 

5 answers

0 votes
Akmal Harith
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 14, 2020

Hi Alexandru,

Looking at your problem, it may relate to how your own environment is being configured. I would say try to install a vanilla instance without any proxy being configured, or bypass your current proxy configurations to verify this.

Could you also please clarify how exactly did you _Changed all "localhost" config references but it seems that they are hardcoded_ ?

Additionally, please take a look at a KB with the basic configurations to get Jira running behind Nginx here:

Try to follow as close as you can to our recommendation.

Hope this helps!

Best regards,
Akmal Harith | Atlassian Support 

Alexandru Lungu March 23, 2020

First time I have tested it without proxy; the same problem.

Replaced all localhost with domain.tld

I did exactly as recommended in Configure Jira server to run behind a NGINX reverse proxy 

0 votes
JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Hi,

I just checked on our 8.7.1 Jira with a newly created user. We use an Apache HTTPD reverse proxy in front of Jira handling SSL and other stuff.

Avatars on the mentioned page (WelcomeToJIRA.jspa) are displayed correctly:

avatarjira.PNG

So I assume, it might be a configuration / caching issue on your side.

Best

JP

Alexandru Lungu March 9, 2020

Almost the same situation here - except that I am using nginx instead of apache.

Is there a known incompatibility between jira and nginx?

The thing is that most of jira works ok; only some of the links point to localhost.

https://community.atlassian.com/t5/Jira-questions/Some-of-jira-links-point-to-localhost/qaq-p/1317799

I mean, I could add/edit projects/issues etc.

JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Hi,

I only know of sample configurations for Apache HTTPD. We use an AJP port of Tomcat to get some better performance & handling of connections between HTTPD & Tomcat. I'm not a nginx expert...

Best

JP

Alexandru Lungu March 10, 2020

I have uninstalled nginx and I tried to use apache; unfortunately there is another problem with apache - I get a mix of http and https links.

 

Can you help me with a config for apache/jira?

I followed the guidelines Securing your Atlassian applications with Apache using SSL and I get exactly the same problem as I got with nginx.

JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 10, 2020

HI,

I assume you terminate SSL/TLS at the proxy & use an unsecured connection between Apache HTTPD and Jira Tomcat.

Our server.xml Connector element using AJP:

<Connector port="8009"
relaxedPathChars="[]|"
relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
minSpareThreads="10"
maxThreads="200"
connectionTimeout="120000"
address="192.168..x.y"
protocol="AJP/1.3"
redirectPort="8444"
enableLookups="false"
URIEncoding="UTF-8"
maxPostSize="-1"
packetSize="65536"/>

On the Apache HTTPD side, the corresponding configuration (Module mod_ajp):

httpd-jk.conf

# Worker config
JkWorkersFile conf/extra/workers.properties
# Logging
JkLogFile logs/mod_jk.log
JkLogLevel warn
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardURICompatUnparsed
JkEnvVar httpd YOURSERVERNAME
# Mount on all vhost and ssl
JkMountCopy All
JkMount  /jira jira;use_server_errors=500
JkMount  /jira/* jira;use_server_errors=500
# Modul (Admin)
JkMount  /jk-manage/* jk-manage
JkMount  /jk-manage jk-manage

<Location /jk-manage >
JkMount jk-manage
Require ip 192.168
Require ip 127
</Location>

workers.properties

# Global Settings
worker.maintain=30

# Default Settings
worker.basic.type=ajp13
worker.basic.socket_keepalive=true
worker.basic.ping_mode=A
worker.basic.ping_timeout=10000
worker.basic.connection_pool_timeout=120
worker.basic.recovery_options=7
worker.basic.lbfactor=1
worker.basic.max_packet_size=65536

# Jira
worker.list=jira
worker.jira.host=192.168.x.y
worker.jira.port=8009
worker.jira.connection_pool_size=200
worker.jira.socket_connect_timeout=3000
worker.jira.reference=worker.basic

# JK Manage Application
worker.list=jk-manage
worker.jk-manage.type=status

 

SSL/TLS is handle by Apache SSL configuration.

Listen 443
Mutex default

<VirtualHost YOURAPACHEIP:443>
Protocols h2 http/1.1
DocumentRoot "..../htdocs"
ServerName YOURFQDNFORYOURSERVER
ServerAdmin admin@a.b
ErrorLog ssl_error.log
TransferLog ssl_access.log
LogLevel warn
SSLEngine On
SSLHonorCipherOrder On
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite USE YOUR CIPHER ORDER
SSLCertificateFile wildcard.crt
SSLCertificateKeyFile wildcard.key
SSLCACertificateFile wildcard.intermediate.crt

Header set Strict-Transport-Security "max-age=16070400; includeSubDomains"   
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/jira [NC]
RewriteCond %{REQUEST_URI} !^/jira/.* [NC]
RewriteCond %{REQUEST_URI} !^/jk-manage/.* [NC]
RewriteRule ^(.*)$ https://YOURFQDNFORYOURSERVER/jira [R=301,L]

# Atlassian Proxy Configuration:
ProxyRequests           Off
ProxyPreserveHost       On

<Proxy *>
Require all granted
</Proxy>

RemoteIPHeader          X-Forwarded-For

</VirtualHost>

You should implement some rules doing a port 80 to port 443 redirection (vhost.conf)

Jira Base URL should be set to

https://YOURFQDNFORYOURSERVER/jira

Good luck

JP

0 votes
JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Is it working, when you use the non-proxy ports?

Best

JP

Alexandru Lungu March 9, 2020

The app is installed on a server without gui - so, no browser - therefore I cannot test if the links with localhost point to real images - and accessing it from another pc implies a different localhost.

0 votes
JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Does localhost pop up in the server.xml?

Best

JP

Alexandru Lungu March 9, 2020

I changed that.

0 votes
JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Hi,

did you set the base URL?

Best

JP

Alexandru Lungu March 9, 2020

Yes, of course.

Suggest an answer

Log in or Sign up to answer