[英]Laravel 502 bad gateway in Ubuntu LEMP stack
我無法訪問我的laravel項目
我在/ var / www中的laravel項目
我用這種方式更新了nginx:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name dev-localserve.co;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
}
location ~ /\.ht {
deny all;
}
}
我該如何解決這個問題?
由於它是Ubuntu存儲庫,我相信你有www-data
用戶。 運行以下兩個命令:
// For setting ownership
chown -R www-data:www-data /var/www/laravel
// For setting permissions
chmod 775 -R /var/www/laravel
另外,我認為你的nginx配置可能還需要更多:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#fastcgi_read_timeout 1800; // this line maybe
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.