3

My new site is not getting picked up. I've created appycontrol.staging:

upstream appycontrol_staging {
  server unix:///var/www/appycontrol.staging/shared/sockets/puma.sock;
}

server {
    listen 80 default_server;
    server_name control-staging.somedomain.com;
    root /var/www/appycontrol.staging/current/public;

    location / {
            proxy_pass http://appycontrol_staging;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

I've added a symbolic link in the sites-enabled directory:

[Staging] deploy@localhost:~$ ls -l /etc/nginx/sites-enabled/
total 0
lrwxrwxrwx 1 root root 45 Nov  3  2015 appyengine.staging -> /etc/nginx/sites-available/appyengine.staging
lrwxrwxrwx 1 root root 46 Jul  7 06:03 appycontrol.staging -> /etc/nginx/sites-available/appycontrol.staging

And I've restarted nginx:

sudo service nginx restart

But control-staging.somedomain.com gets picked up by the appyengine.staging site instead.

What am I missing?

1
  • Providing log data may help you in getting an answer.
    – Paul
    Jul 7, 2016 at 17:52

2 Answers 2

1

You've probably used a wild card domain in the other config file, or starting nginx fails for some reason.

Also ///var/ should just be /var/.

1
  • I didn't have a wild card and I didn't get any error when restarting nginx. Although there was an error in the error log. Jul 11, 2016 at 4:00
1

After checking the nginx error log, I had this:

2016/07/11 03:53:40 [emerg] 10446#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/appyengine.staging:6

So I changed line 6 to listen 80 and restarted nginx. Then it worked.

You must log in to answer this question.

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