我面对nginx的问题,这花了我一整天的时间。我在互联网上尝试了很多解决方案但没有成功。 我通过自制软件在MAC上安装了nginx,mysql,php-fpm。它的安装非常简单。除了一件事,一切都按预期工作。当我试图访问我的网站时,它会返回404.
以下是日志,nginx配置,文件系统结构和&特权。
server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name emarketing.com www.emarketing.com;
root /Users/summernguyen/Documents/workspace/e-marketing/web;
index index.php;
access_log /Users/summernguyen/Documents/workspace/e-marketing/runtime/logs/access.log;
error_log /Users/summernguyen/Documents/workspace/e-marketing/runtime/logs/error.log debug;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
http://i.stack.imgur.com/gsuQt.png
http://i.stack.imgur.com/XKWAQ.png
有人解决了这类问题吗?请帮帮我。
答案 0 :(得分:0)
之前我遇到过这个问题,正如日志已经说过的那样 - 是权限问题。您必须确保您网站根目录的每个文件夹都具有执行权限。
您可以使用 chmod + x / path
执行此操作