Laravel|nginx|php7|Ubuntu 16 = 502 Bad Gateway
Hello,
I'm using nginx first time (usually used apache) and i can't get it working. I rebuilded my droplet from digital ocean multible times.
I used this tutorial to set it up: https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-an-nginx-web-server-on-ubuntu-14-04
Ecept one line is fastcgi_pass unix:/var/run/php7.0-fpm.sock;
Also used this. I have also used alot of other tutorials reinstall removed and everything. I just cant get this fixed.
My domain is alanaasmaa.eu
my dir is /var/www/laravel/public
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
include fastcgi_params;
fastcgi_keep_conn on;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
}
}
Changed fastcgi_pass unix:/var/run/php7.0-fpm.sock; to fastcgi_pass 127.0.0.1:9000;
And now it works.
Please or to participate in this conversation.