Crowd behind NGINX both running in Docker containers

We have the following experimental setup for Crowd. There are 3 docker containers running in Ubuntu - Crowd, Postgres and NGINX as a reverse proxy. The idea was that this setup should be easily replicated and started with docker-sompose on different host when needed.

Everything starts up and runs ok. I configured Crowd to connect to Postgres and added new Confluence client application. However when I try to authenticate user in Confluence it shows Crowd exception like the following:

"HTTP Status 403 - Client with address "172.18.0.5" is forbidden from making requests to the application"

172.18.0.5 is one of the internal docker IP addresses - I believe it is one of the NGINX container. I can not figure out why is it showing this address instead of real remote IP. I have these lines in NGINX configuration:

location / {
 proxy_set_header    Host            $host;
 proxy_set_header    X-Real-IP       $remote_addr;
 proxy_set_header    X-Forwarded-for $proxy_add_x_forwarded_for;
 port_in_redirect off;
 proxy_redirect   http://crowd.example.com/ /;
 proxy_pass http://crowd:8095;
}

Shouldn't the X-Real-IP be passed to Crowd ? Anybody had similar setup working or have an idea what I could try ?

Thank you

HTTP Status 403 - Client with address "172.18.0.5" is forbidden from making requests to the application

HTTP Status 403 - Client with address "172.18.0.5" is forbidden from making requests to the application

1 answer

1 accepted

0 votes
Accepted answer
Lukasz Pater Atlassian Team Nov 22, 2016

Hi RVal,

Crowd will use the X-Forwarded-For header as the source ip for the validating the request, but the proxy IP needs to be added to the Trusted Proxy Servers list in Crowd. Please see https://confluence.atlassian.com/crowd/configuring-trusted-proxy-servers-158107219.html for more details.

Thank you for your help. Adding my proxy IP to Trusted Proxy Servers made Crowd to use X-Forwarded-For header instead of my proxy IP as a remote client IP. Thanks a lot.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 12 hours ago in Jira Ops

Jira Ops EAP Update #6: Slack improvements + three ways to get a live Jira Ops demo!

Welcome to your weekly Jira Ops Early Access program update, where we’re sharing news and updates on Jira Ops progress as we work toward our 1.0 release. If you ever want to drop us feedback or ideas...

26 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you