I'm currently setting JIRA and Confluence up and am uncertain how NGINX should be configured to act as a reverse proxy for both when they're both being accessed via port 80.
I currently have it set up as follows:
server {
listen 80;
server_name www.jira.example.net;
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://localhost:8080;
client_max_body_size 20M;
}
}
server {
listen 80;
server_name www.confluence.example.net;
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://localhost:8090;
client_max_body_size 20M;
}
}As you may be able to tell, this code will not redirect correctly.
What do I need to change to allow NGINX to properly route traffic to the correct application?