將 VPS 移到不同目錄後出現 403

將 VPS 移到不同目錄後出現 403

建立我的網站後,我意識到我們的 RAID 已設定為所有空間都分配在/home/admin/資料夾中。

因此,我將所有網站從 複製/var/www//home/admin/www/。我還像這樣 chmodded 目錄:

sudo chown -R root:root /home/admin/www/website.com/public_html

sudo chmod 755 /home/admin/www

然後我重新啟動了 nginx,所有系統都顯示為綠色,但現在我在訪問我的網站時收到 403 錯誤。

這是我的虛擬設定檔文件:

server {
    listen       80;
#    listen       *:80;
    server_name  website.com www.website.com;
    access_log   /home/admin/www/html/website.com/public_html/access.log;
    error_log    /home/admin/www/html/website.com/public_html/error.log;

    location / {
        root   /home/admin/www/html/website.com/public_html;
         index  index.php index.html index.htm;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /home/admin/www/html/website.com/public_html$fastcgi_script_name;
    }

}


server {
    listen       80;
#    listen       *:80;
    server_name  website2.com www.website2.com;

    location / {
        root   /home/admin/www/html/website2.com/public_html/;
         index  index.php index.html index.htm;
    }
}

謝謝!

相關內容