1

I am setting up JIRA Software in a Docker container. JIRA is listening on 127.0.0.1:8080. I have my reverse proxy on https://hostname/jira redirecting the traffic using this config:

location /jira {
proxy_set_header X-Forwarded-Proto  $scheme;
proxy_set_header X-Real-IP          $remote_addr;
proxy_set_header Host               $host;
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://127.0.0.1:8080;
proxy_redirect   off;
}

The problem is that I get a 302 redirect loop. When I visit https://hostname/jira I get redirected to https://hostname/jira/jira/secure/SetupMode!default.jspa over and over again. That would be the correct URL except for the extra "/jira" fragment.

1
  • I have since added the statement "rewrite ^/jira(/jira/.*) $1 last;" directly before the location block, but it appears to have no effect on the behavior. Now I'm really stumped.
    – scott8035
    Apr 19, 2018 at 20:55

1 Answer 1

0

That would be the correct URL except for the extra /jira fragment.

Rather than using location /jira, you might consider adding your proxy as a sub-domain in a new server block e.g.:

server {
    listen       80;
    server_name  jira.hostname;

    location / {
       proxy_set_header X-Forwarded-Proto  $scheme;
       proxy_set_header X-Real-IP          $remote_addr;
       proxy_set_header Host               $host;
       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://127.0.0.1:8080;
       proxy_redirect   off;
       }
}

If you decide to try this, don't forget to update any appropriate DNS records (or similar) to point jira.hostname to the correct IP (e.g. 127.0.0.1).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .