I'm facing with a problem with nginx which took me a whole day. I tried many solutions found on the internet but no success. I installed nginx, mysql, php-fpm on MAC through homebrew. It's really easy to install. Everything works as expected except one thing. When every I try to get to my website, it return 404.
Here are the logs, the nginx configuration, the file system structure & privileges.
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
Anyone has solved this kind of problem ? Please help me.