Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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 failed (98: Address already in use)
[emerg]: bind() to failed (98: Address already in use)
[emerg]: bind() to failed (98: Address already in use)
[emerg]: bind() to failed (98: Address already in use)
[emerg]: bind() to failed (98: Address already in use)
[emerg]: still could not bind()

any ideas?

nginx log

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

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:, server: zarkon, request:
"GET / HTTP/1.1", upstream: "http://unix:/srv/zarcon/shared/unicorn.sock:/", host: ""
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 already. – pkhamre Oct 17 '12 at 6:48
done – 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
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/; string

share|improve this answer

Your Answer


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.