I've read a tutorial on configuring nginx to reverse proxy
In the configuration file, we use a sock
server {
listen 80;
server_name server_domain_or_IP;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/user/myproject/myproject.sock;
}
}
Now, I'm reading other tutorials in order to do a load balancing with nginx
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-load-balancing https://www.upcloud.com/support/how-to-set-up-load-balancing/
However, it is strange that we no longer need the location of the sockets in the configuration file.
upstream backend {
server backend1.example.com;
server backend2.example.com;
server backend3.example.com;
}
server {
location / {
proxy_pass http://backend;
}
}
Is it normal or is there a specificity with uwsgi ?
Will I need to add the location of the sockets in the configuration file or are they not needed ? If so, how ? On the server, do I need to create a socket ? If the configuration file does not specify the location of the socket, how will it be used ?
EDIT : I've also read a tutorial when socket are defined this way
socket = :5000
and the socket is not mentionned in the configuration file.
Is this the way to do it when load balancing ?
server unix:/home/user/myproject/myproject.sock;instead of an ip or domain and I have also seen that prefixhttp://is not needed inhttp://backend. Still I haven't made it work so it is possible that you will run into issues. - kon psych