Install Nginx under Mac OS X there are not many friends, because in the MAC system installation Nginx environment is not practical, but someone touched us together to see, maybe it will help you.
I was nginx through the brew install, and the front was smooth,
Nginx Common commands:
Nginx-s Stop/quit/reopen/reload
Use the Ln-s command to create a software link under/usr/sbin/for easy operation.
directly to a server to see the effect, the code is as follows:
server {
Listen 80;
server_name www.geekso.com;
Index index.html index.htm index.php;
Root/users/han/documents/git/msg/web/public;
Location =/favicon.ico {
Log_not_found off;
Access_log off;
}
Location =/robots.txt {
Allow all;
Log_not_found off;
Access_log off;
}
Location/{
Try_files $uri $uri//index.php $args;
}
Location ~. php$ {
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Include fastcgi.conf;
}
Location ~/(. svn|. Git|. Ht|. DS) {
Deny all;
Internal
}
Location ~*. (Js|css|png|jpg|jpeg|gif|ico) $ {
Expires Max;
Log_not_found off;
}
}
Then sudo command restart Nginx, access to www.3lian.net found PHP files can access the execution, access to pictures, JS, css ... Just report 403 Forbidden?
403 is not without permission, OK, plus permission 750 should be able to resolve, plus to find or 403, this does not understand. Will I nginx configuration wrong, a line to see, or did not find the problem, has been thinking why the same directory of PHP files can be accessed, access to other documents on the report 403, all kinds of exclusion, engage in nginx, or not. Finally by Google search and really found the same people as I met.
Solution: Use Ls-l to view/users/,/users/xxx/,/users/xxx/documents/,/users/xxx/documents/git/permissions to ensure that the last X (other user's execution rights) is included, if/ users/xxx/documents/missing X, execute chmod o+x/users/xxx/documents/add x permissions.
Actually engaged in a half-day is also a question of authority.