带有Traefik反向代理的JIRA Docker(cptactionhank)

时间:2019-07-18 17:29:06

标签: docker jira traefik

我正在尝试将JIRA和GITLAB都设置为Docker容器,并使用Traefik容器作为反向代理,尝试获取以下URL重定向:

  • myserver.com/gitlab => GitLab容器
  • myserver.com/jira => JIRA容器

我的Docker-compose文件如下:

version: '3'

services:
  reverse-proxy:
    image: traefik:alpine # The official Traefik docker image
    command: --api --docker --accessLog --logLevel="DEBUG" 
    ports:
      - "80:80"     # The HTTP port
      - "443:443"     # The HTTP port
      - "8080:8080" # The Web UI (enabled by --api)
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events

  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'myserver.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'myserver.com/gitlab'
        # Add any other gitlab.rb configuration here, each on its own line
    volumes:
     - '/var/gitlab/config:/etc/gitlab'
     - '/var/gitlab/logs:/var/log/gitlab'
     - '/var/gitlab/data:/var/opt/gitlab'
    labels:
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:myserver.com;PathPrefix:/gitlab"
      - "traefik.port=80"

  jira:
    image: 'cptactionhank/atlassian-jira-software:latest'
    container_name: jira
    restart: unless-stopped
    hostname: 'myserver.com'
    healthcheck:
      disable: true
    volumes:
      - '/var/atlassian/jira:/var/atlassian/jira'
    labels:
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:myserver.com;PathPrefix:/jira"
      - "traefik.port=8080"

问题: 虽然这对于/ gitlab重定向工作正常,但/ jira返回503错误。

如果我删除了;PathPrefix:/jira,则myserver.com(不带后缀/jira)会完美地重定向到JIRA容器。

有什么主意吗?

0 个答案:

没有答案