1

I run into a minor issue when trying to configure Jira 7.3.5 using a nginx reverse proxy on my local network. I use the cptactionhank jira docker image together with the jwilder nginx-proxy docker image. Everything seems to run fine, but since my update to version 7.3.5, Jira reports an issue with the "base url for gadgets". When opening the support-tools section of the Jira configuration pannel, it states "JIRA is not able to access itself through the configured Base URL". The result is that gadgets on the dashboard don't report their correct names.

It seems to have to do with re-routing the traffic to port 80 through port 8080. When I set the base url in Jira to port 8080, the issue disappears, but unfortunately all my jira urls will be postfixed with port 8080. I tried setting X_PROXY_PORT to 80 and tried to set VIRTUAL_PORT as well in my docker-compose environment, but none of that seemed to change much. I was hoping anyone here had experience with this setup?

Here is my jira docker-compose.yml file:

version: '2'

services:
  jira:
    container_name: jira
    restart: always
    image: cptactionhank/atlassian-jira-software:latest
    ports:
    - "8080:8080"
    volumes:
    - jira-data:/var/atlassian/jira
    - jira-logs-data:/opt/atlassian/jira/logs
    dns: 192.168.2.4
    expose:
    - "8080"
    hostname: jira.internal.mydomain.com
    network_mode: bridge
    environment:
    - VIRTUAL_HOST=jira.internal.mydomain.com

volumes:
  jira-data:
    external: true
  jira-logs-data:
    external: true

and here is my nginx docker-compose.yml file

version: '2'

services:
  nginx:
    container_name: nginx
    restart: always
    image: jwilder/nginx-proxy
    ports:
    - "80:80"
    volumes:
    - /var/run/docker.sock:/tmp/docker.sock:ro
    - /srv/nginx-proxy/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro
    dns: 192.168.2.4
    network_mode: bridge
mojoritty
  • 21
  • 3

2 Answers2

0

So, you've got jira listening on port 8080 and nginx routing port 80 to 8080? Is that right?

It sounds like jira isn't using the proxy to talk to itself. I'm guessing that's because it's trying the wrong IP address and the proxy isn't listening on that address. That's easy to check with 'ss -tln' or 'netstat -tln'

Hope that helps -Dylan

update:

Huh, that looks like you've got something listening on port 8080 and something listening on port 8005, but nothing listening on port 80. That makes me think nginx isn't configured right. Or, are you publishing port 8005 as port 80 outside the container? That would cause the problem, because internal to the container, port 80 isn't anything. I think you could set up a simple forwarding rule in iptables in the container to redirect port 80 to port 8005 locally. That would probably fix it. Or just put nginx on port 80 and publish as port 80.

Dylan Martin
  • 548
  • 4
  • 14
  • Thanks for your answer. Jira is indeed listening on 8080 and nginx is routing 80 to 8080. when I run ss -tln from within the jira docker image it returns `State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 1 ::ffff:127.0.0.1:8005 :::* LISTEN 0 100 :::http-alt :::*` Any suggestions how jira can be persuaded to use the right address? – mojoritty May 01 '17 at 15:00
  • Sorry, added the wrong ss -tln output. Here is the coorect one 'State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 1 ::ffff:127.0.0.1:8005 :::* LISTEN 0 100 :::8080 :::*' – mojoritty May 01 '17 at 15:06
0

I seem to have found the solution to the issue. Disabling the 'expose: "8080"' and 'hostname: jira.internal.mydomain.com' lines in my jira docker-compose file seems to make sure all routing is done as is should. I set the jira base url just to http://jira.internal.mydomain.com and everything seems to work correctly.

mojoritty
  • 21
  • 3