nginx配置信息
server {
listen 8081;
server_name localhost;
root /Volumes/New/phpmyadmin;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 9090;
server_name localhost;
root /Volumes/New/mycode/xxxx/public;
try_files $uri $uri/ /index.php?$args;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
重新启动nginx
brew services restart nginx
查看nginx配置所在位置的命令
$ nginx -t
admin@gz servers % nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
admin@gz servers %