gpt4 book ai didi

ubuntu - Nginx 在 Ubuntu 上返回 404?

转载 作者:行者123 更新时间:2023-12-04 19:00:19 24 4
gpt4 key购买 nike

我决定将我的 nginx 站点根目录更改为 nginx 目录( etc/nginx )之外的其他位置,但现在它似乎破坏了某些东西,我认为它的权限?

有人告诉我你不能在它的 nginx 目录之外有一个 nginx 站点,但我认为这不是真的,因为它没有多大意义,但这是我尝试过的日志和命令。

Checked my error log and it seems to be returning this:
2019/03/25 22:53:25 [crit] 2107#2107: *1 stat() "/media/developer/megasync/workspace/coding/projects/websites/codeshare/public/" failed (13: Permission denied), cli$
2019/03/25 22:55:40 [crit] 2329#2329: *1 stat() "/media/developer/megasync/workspace/coding/projects/websites/codeshare/public/" failed (13: Permission denied), cli$

我试过这些命令,没有工作。
sudo chown -R www-data /media/developer/megasync/workspace/coding/projects/websites
sudo chown -R www-data:www-data /media/developer/megasync/workspace/coding/projects/websites
sudo chown -R developer:www-data /media/developer/megasync/workspace/coding/projects/websites

运行每一项后重新启动 nginx 服务。

404 未找到
nginx/1.15.5 (Ubuntu)

运行 namei -om /media/developer/megasync/workspace/coding/projects/websites返回
drwxr-xr-x root      root      /
drwxr-xr-x root root media
drwxr-x--- root root developer
drwxrwxrwx developer developer megasync
drwxrwxrwx developer developer workspace
drwxrwxrwx developer developer coding
drwxrwxrwx developer developer projects
drwxrwxrwx developer developer websites

配置文件:
server {
listen 80;
root /media/developer/megasync/workspace/coding/projects/websites/codeshare.io/public;
index index.php index.html index.htm;
server_name landing.io;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}

最佳答案

运行namei -om /media/developer/megasync/workspace/coding/projects/websites你会看到developer正在阻止对任何子目录的权限

关于ubuntu - Nginx 在 Ubuntu 上返回 404?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55347572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com