在 nginx 服务器上部署 CodeIgniter 3 项目后出现错误 500

时间:2021-02-24 13:40:32

标签: nginx codeigniter-3 ubuntu-18.04

我正在使用 Ubuntu 18.04 VPS 并尝试在 nginx 服务器上部署 CodeIgniter 项目。不幸的是,nginx 配置文件似乎有问题。这是文件:

nginx 配置:

server {
    listen 80;
    listen [::]:80;

    # Server Name
    server_name doamin.com;
    
    # Document Root
    root /var/www/html/domain.com;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm;
    
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    
    # pass PHP scripts to FastCGI server
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

        # With php-fpm:
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }


    error_page 404 /index.php;

    # deny access to hidden files such as .htaccess & .git
    location ~ /\. {
        deny all;
    }
    
}

目录权限

<块引用>

cd /var/www/

drwxr-xr-x  3 www-data www-data 4096 Feb 24 12:54 html/
<块引用>

cd html/

drwxr-xr-x 6 root     root     4096 Feb 24 12:54 domain.com/
<块引用>

cd domain.com/

drwxr-xr-x  8 root     root      4096 Feb 24 12:54 .git/
-rwxr-xr-x  1 root     root         0 Feb 24 12:54 .gitignore*
-rwxr-xr-x  1 root     root       241 Feb 24 12:54 .htaccess*
-rwxr-xr-x  1 root     root      7035 Feb 24 12:54 README.md*
drwxr-xr-x 14 root     root      4096 Feb 24 12:54 application/
drwxr-xr-x  8 root     root      4096 Feb 24 12:54 assets/
-rwxr-xr-x  1 root     root       593 Feb 24 12:54 composer.json*
-rwxr-xr-x  1 root     root     19306 Feb 24 12:54 database_schema.sql*
-rwxr-xr-x  1 root     root     10722 Feb 24 12:54 index.php*
drwxr-xr-x  8 root     root      4096 Feb 24 12:54 system/

请帮忙。

0 个答案:

没有答案
相关问题