1、添加server
server {
listen 8001;
server_name localhost;
root /home/ebayerp;
location / {
index index.html index.htm index.php;
}
location ~ \.php$ {
# root "/home/ebayerp";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
access_log /home/wwwlogs/ebayerp-access.log;
}
重启nginx服务,效果如下

如果访问不了,查看

设置关闭:

即可访问。

本文详细介绍如何在Nginx中配置server模块,包括监听端口、设置域名、指定根目录、配置location规则等,同时讲解了如何设置PHP的FastCGI参数,以及如何设置访问日志。
307

被折叠的 条评论
为什么被折叠?



