簡體   English   中英

Urantu LEMP堆棧中的Laravel 502壞網關

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM