2👍
That socket file will be created automatically by uwsgi. If you look further in the documentation you linked to, you’ll find instructions to put the following line in your mysite_uwsgi.ini
:
socket = /path/to/your/project/mysite.sock
This tells uwsgi where to create the socket for your application. The following line from your nginx configuration:
server unix:///path/to/your/mysite/mysite.sock; # for a file socket
tells nginx where to look for the socket. The two paths in each configuration file must be identical (or resolve to the same file).
As chuk2bp mentioned, the socket file is a communication channel. In this case it allows nginx to talk to uwsgi.
3👍
.sock files are unix sockets (also called IPC sockets as well) and are programmatically created to allow information to be exchanged between processes. In this case, mysite.sock allows for information to be exchanged between uwsgi and nginx. Sockets, when applicable, are used alternatively to ports which have much more overhead. For the purposes of similarity, think “piping” between processes.
This article in particular helped me understand sockets much more effectively. Give it a read!
- [Django]-Django Channels 2.0: call Consumer's channel by its name
- [Django]-Django with django-nose: two identical settings files with different behavior in running test command
- [Django]-How to filter a Django QuerySet's related fields' 'all' or 'none'
0👍
as @Louis’s answer.
server unix:///path/to/your/mysite/mysite.sock; # for a file socket
You just change
unix:///path/to/your/mysite/mysite.sock;
to
unix:///home/h/workspace/sun-asterisk/POC-makeup/deploy-tutorial/nginx-tutorial/mysite/mysite.sock;
Note: /home/h/workspace/sun-asterisk/POC-makeup/deploy-tutorial/nginx-tutorial/mysite is my project path.
- [Django]-Transmit JSON data to Django website
- [Django]-Error when trying to compress static files when using django-storages and django-compressor together
- [Django]-NameError: name PositiveSmallIntegerField is not defined
- [Django]-Django CBV DetailView – accessing the object to assign to a context variable?
- [Django]-Django-filter and aggregate functions