来自一个前端的成长
查看环境
修改nginx配置文件
红线是nginx的文件地址
Finder —> shift + command + G 找到nginx,修改配置文件
一开始是根据某位大哥的文章改的,网址自取 https://segmentfault.com/a/1190000002556269
但是改了以后,还是打不开wordpress,后来麻烦了可爱的后端小哥哥
在nginx文件下,新建conf.d和global
在conf.d/下,新建文件default.conf,配置default.conf:
server {
# 端口
listen 8000 default_server;
# listen [::]:80 default_server;
# 访问的域名
# server_name localhost;
# 默认网站根目录(www目录)
root /users/skywen_cp/Documents/work/wordpress-skywen-site;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
# 设置监听端口
fastcgi_pass 127.0.0.1:9000;
# 设置nginx的默认首页文件(上面已经设置过了,可以删除)
fastcgi_index index.php;
# 设置脚本文件请求的路径
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# 引入fastcgi的配置文件
include fastcgi_params;
fastcgi_intercept_errors on;
}
}
同样在conf.d/下,新建文件mywordpress.con