server {
listen 80; //端口
server_name conquer.ayibang.cc; //主机
root /data/htdocs/conquer/public;//文件目录
index index.html index.php; //默认访问的首页
//url重写
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php last;
}
}
//php cgi模块
location ~ \.php$ {
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#以下是log模块-记录nginx日志
log_format access_conquer '$remote_addr - $remote_user [$time_local] "$request" '
'$status "$http_referer" '
'"$http_user_agent" $server_name $request_body $bytes_sent $request_length $request_time';
access_log /data/logs/access_conquer_test.log access_conquer;
}
listen 80; //端口
server_name conquer.ayibang.cc; //主机
root /data/htdocs/conquer/public;//文件目录
index index.html index.php; //默认访问的首页
//url重写
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php last;
}
}
//php cgi模块
location ~ \.php$ {
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#以下是log模块-记录nginx日志
log_format access_conquer '$remote_addr - $remote_user [$time_local] "$request" '
'$status "$http_referer" '
'"$http_user_agent" $server_name $request_body $bytes_sent $request_length $request_time';
access_log /data/logs/access_conquer_test.log access_conquer;
}