Author Topic: nginx server socket file not created for one of my users  (Read 3826 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
nginx server socket file not created for one of my users
« on: March 03, 2020, 03:49:11 PM »
I switched from Apache to nginx server for a few reasons. First, it seems nginx performance is better. When doing this, nginx created a bunch of conf files for each user account and a vhost based on the user domains listed (all the same domain, different sites).

The installation worked for 2 of the user accounts on the server, but the third one gave me a 502 bad gateway error.

On the server side, I got the following entry:
2020/03/03 23:27:54 [crit] 22783#22783: *568 connect() to unix:/opt/alt/php-fpm56/usr/var/sockets/xxx.sock failed (2: No such file or directory) while connecting to upstream, client: 99.229.203.249, server: *.domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/opt/alt/php-fpm56/usr/var/sockets/xxx.sock:", host: "xxx.domain.com"

where 'xxx' is the user account and 'domain.com' is the fqdn of the server domain.

When I look at the /opt/alt/php-fpm56/usr/var/sockets/ directory, it shows .sock files for each of the other users plus a 'nobody.sock' which I suppose is the default.

how do i either configure nginx to create xxx.sock or create the file myself so I can resolve this issue?

Any help is appreciated.

Offline
*
Re: nginx server socket file not created for one of my users
« Reply #1 on: January 05, 2023, 01:20:43 PM »
This is old, but I had the same problem and it has been solved checking the permission on the username folder where is stored the websites of this user. It has to be writable for the owner (perhaps 755)

Offline
*****
Re: nginx server socket file not created for one of my users
« Reply #2 on: January 30, 2023, 04:42:54 AM »
Actually, this is not an nginx error; this is a php-fpm error. When installing a new PHP version, it does not carry over your existing user conf files from an existing PHP version to the newly built one. You have to copy the user conf from an existing version of PHP and then edit the paths inside the file as appropriate (ie simply changing php71 to be php56 in this case).