I'm running a debian (jessie, 64-bit) server with nginx, jira and bitbucket installed. the url is referred to as "www.example.com"
First I installed jira, opened the setup site (http://example.com:8080
) and finished the installation.
After that I created a virtual host "jira.example.com" in /etc/nginx/sites-available and created the corresponding symlink in /etc/nginx/sites-enabled:
server {
listen 80;
server_name jira.example.com;
location / {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
this works fine. When I open http://jira.example.com
it takes me to my jira-dashboard.
Then I installed bitbucket and openen the setup page on http://example.com:7990
which works, too.
I then decided to create another virtual host named "bitbucket.example.com":
server {
listen 80;
server_name bitbucket.example.com;
location / {
proxy_pass http://localhost:7990/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
but this one doesn't work whereas jira works completely fine.
When I edited the include /etc/nginx/sites-enabled/*;
-line in the nginx.conf to include /etc/nginx/sites-enabled/*.*;
it redirects every http://example.com/*
to http://example.com:7990
so I think I misconfigured nginx somehow.