Reputation: 247
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/thinkshare/public/;
index index.php;
server_name domain_here;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Here is my current NGinx configuration - I cannot for the life of me figure out what exactly is happening to warrent a 502 Gateway Error on connection, domain or IP direct. Any thoughts?
edit
Removed Domain
Upvotes: 0
Views: 3658
Reputation: 317
In Ubuntu 16.04 I get this error too. I resolved it by editing the
/etc/php/7.0/fpm/pool.d/www.conf
user = yourname
group = yourgroup
listen.owner = yourname
listen.group = yourgroup
and restart php7.0fpm by the use of $sudo service php7.0-fpm restart
This error is due to your path isn't in default /var/www
which is owned by www-data
when you in other directory, you should set it!
Upvotes: 0
Reputation:
Permissions for the socket are incorrect and the reason why changing to top solved it
Upvotes: 0