一.sock方式(宝塔一键安装)
1.nginx配置文件
server
{
listen 100;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/manager/public;
include enable-php-70.conf;
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php last;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
location /.git
{
deny all;
return 403;
}
access_log /www/wwwlogs/manager.com.log;
error_log /www/wwwlogs/manager.com.error.log;
}
2.enable-php-70.conf:
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-70.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}
二.编译安装方式
server {
listen 80;
server_name xx.xxx.com;
index index.html index.php;
root /alidata/www/apays;
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php last;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
location /.git
{
deny all;
return 403;
}
access_log /alidata/log/nginx/access/xx.xxxx.com.log;
}