Forums

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

HAProxy 2.8 and JIRA 7.1.9 - 404 Not Found Error

Can Erdem
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 8, 2023

Hello Guys,

We are using Jira 7.1.9 and it is working fine with a nginx reserve proxy. Now we are switching to HAProxy. Every server and product in datacenter working fine except Jira. Does anyone have an idea or experience about it?

Both http://jira.xxxxx.xxx and https://jira.xxxxx.xxx are giving the following screen

Capture.PNG

Server.xml (Connector Info)
<Connector port="8080" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true"
proxyName="jira.xxxxx.xxx" proxyPort="80"/>

nginx.conf
upstream jira {
  server 10.0.0.5:8080;
}

server {
  listen 80;
  server_name jira.xxxxx.xxx;
  location / {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://jira;
    client_max_body_size 10M;
  }
}

haproxy.cfg

frontend  default-frontend
  mode http
  
bind *:80
  bind *:443 ssl crt /etc/haproxy/ssl/
  acl host_jira hdr(host) -i jira.xxxxx.xx
  compression algo gzip
  compression type text/css text/html text/javascript application/javascript text/plain text/xml application/json image/svg+xml
  option forwardfor
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Real-IP %[src]
  http-request set-header X-Forwarded-Host %[req.hdr(Host)]
  http-request set-header X-Forwarded-Server %[req.hdr(Host)]
  http-request set-header X-Forwarded-Port %[dst_port]
  http-request redirect scheme https unless { ssl_fc } or host_jira
  use_backend %[req.hdr(host),lower,map_dom(/etc/haproxy/hosts.map,ha-backend)]
backend jira-backend
  mode http
  server jira 10.0.0.5:8080 check

hosts.map
jira.xxxxx.xxx jira-backend

1 answer

0 votes
Hauke Bruno Wollentin
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.
December 8, 2023

Your config doesn't look wrong at all.

We also run our Jiras behind HAProxy, the main difference is that we use the HTTPS scheme with proxyPort=443 set in server.xml rather than plain HTTP with proxyPort=80.

Also your screenshot doesn't look like Jira DC 404s at all. Are you sure that the HAProxy hits the correct backend?

Suggest an answer

Log in or Sign up to answer