【发布时间】:2014-09-21 00:14:07
【问题描述】:
我遇到了一个 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
有人解决过这种问题吗?请帮帮我。
【问题讨论】: