Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to deploy my app via capistrano. It was done, but when I start to nginx and show my site in the browser I see 'We're sorry, but something went wrong.'

It is bad. I use unicorn. See my configs https://gist.github.com/3904032 I try to start server via rails s -e prodiction and it's work!

I think that this error may be because I can't restart server

root@li272-194:~# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
nginx.

any ideas?

nginx log

2012/10/17 02:57:41 [error] 3271#0: *1 could not find named location "@myapp", client: 91.192.62.77, server: 178.79.153.194, request: "GET / HTTP/1.1", host: "178.79.153.194"

2012/10/17 02:19:08 [crit] 2448#0: *8 connect() to unix:/srv/zarcon/shared/unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: 91.192.62.77, server: zarkon, request:
"GET / HTTP/1.1", upstream: "http://unix:/srv/zarcon/shared/unicorn.sock:/", host: "178.79.153.194"
share|improve this question
    
Something is already binding to a port that nginx tries to bind to. –  pkhamre Oct 17 '12 at 6:46
    
yes, but who is? –  achempion Oct 17 '12 at 6:47
    
Use e.g. lsof -i -U or netstat -ntlp and check if there is something listening to 0.0.0.0:80 already. –  pkhamre Oct 17 '12 at 6:48
1  
done gist.github.com/3904092 –  achempion Oct 17 '12 at 6:52
    
Are you sure that nginx stops before it gets started again? Can you try to run /etc/init.d/nginx stop and then verify that the process is gone and nothing is listening on :80 before you start up nginx again? –  pkhamre Oct 17 '12 at 6:54

1 Answer 1

up vote 0 down vote accepted

Line 32 in your nginx configuration refer to @myapp

try_files $uri/index.html $uri.html $uri @myapp;

Did you mean to refer to @zarkon?

try_files $uri/index.html $uri.html $uri @zarkon;

and commit pid /tmp/nginx.pid; string

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.