A
A
archi19982014-11-03 12:43:16
Django
archi1998, 2014-11-03 12:43:16

Why doesn't the site show up when I use sockets instead of ports in uwsgi?

There is a site mysite.ru. In nginx config:
upstream django{
server unix:///home/projects/mysite/mysite.sock;
}
server{
listen 80;
server_name mysite.ru;
charset utf-8;
client_max_body_size 75M;
location /media/{
alias /home/projects/mysite/media;
}
location /static/{
alias /home/projects/mysite/static;
}
location /{
uwsgi_pass django;
include /home/projects/mysite/uwsgi_params;
}
}
I execute the nginx restart command, everything works.
Next I run uwsgi:
1. uwsgi --http :8000 --module mysite.wsgi
When I navigate to mysite.ru:8000, I see the django
2 start page. uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=
666 writes that the data is not available, that is, it does not work.
If anyone knows what needs to be done to "tie up" nginx django uwsgi, and so that when you go to mysite.ru, the site itself is displayed, and not Welcome to nginx, please write what needs to be done, thanks in advance .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2014-11-04
@archi1998

Judging by the nginx configuration, it listens to the standard port 80, but for some reason you go to mysite.ru:8000.

G
gmlexx, 2014-11-03
@gmlexx

If you enable debug error level in nginx and look at the log, then there is likely to be an answer to the question "why".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question