Nginx – Reverse Proxy with Nginx showing default screen

confluencejiranginxreverse-proxy

I'm trying to setup a reverse proxy to my JIRA instance using Nginx.

server {
  listen 80;
  server_name jira.domain.com;
  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;
  }
}

Every time I hit the url directly, I get the default "Welcome to Nginx" page. If I refresh, it then takes me to the JIRA Dashboard. I'm having the same issue going to my Confluence box behind Nginx. What am I missing to get this to work correctly?

Best Answer

There isn't anything wrong with the code, the server_name is set correctly from what I can see. If you're accessing IP address of the server, than it wouldn't be served as NGINX is (in your configuration) only configured to display content from "jira.domain.com".

By the way, could you elaborate a bit? How about the rest of the configuration, if it's compiled or installed by an installer? Your "nginx.conf" or "default.conf"?

Related Topic