博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决macos下配置nginx+php-fpm出现 file not found的问题
阅读量:2727 次
发布时间:2019-05-13

本文共 2064 字,大约阅读时间需要 6 分钟。

原配置文件/usr/local/etc/nginx/servers/discuz.php

server {
listen 8081; server_name localhost; location / {
root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html {
root html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ {
root html; #这里要删去 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; }

修改为:

server {
listen 8081; server_name localhost; root /Users/fjh1997/upload; #这里要注意 #charset koi8-r; #access_log logs/host.access.log main; location / {
index index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html {
root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ {
# proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # 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; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht {
# deny all; #} }

需要注意的是,务必删去 location ~ .php$ {里面的root项,同时修改/scripts f a s t c g i s c r i p t n a m e ; 为 fastcgi_script_name;为 fastcgiscriptname;document_root$fastcgi_script_name;,并在location外层添加root项。如本例为/Users/fjh1997/upload;

转载地址:http://usstd.baihongyu.com/

你可能感兴趣的文章
网络安全基础知识
查看>>
最详细 vsphere创建Windows service虚拟机,并安装VMware Tools 进行配置
查看>>
【html/css】如何设置HTML span 的宽度
查看>>
ubuntu12.10更新包后的问题
查看>>
【web开发】EL表达式的一些用法小结
查看>>
【mysql】关于命令load data local infile
查看>>
如何选择更适合你的 Linux 发行版?
查看>>
数据分析师必知必会的7款Python工具
查看>>
又到招聘季,说说网络招聘的那些坑
查看>>
Windows RDP远程桌面无密码账户
查看>>
构建嵌入式版本的 ACE TAO 6.5.3
查看>>
一位台湾软件工程师的心路历程
查看>>
程序员们的时间管理法则
查看>>
SpringMVC @PathVariable 映射 URL 绑定的占位符 /{xxx}
查看>>
non-compatible bean definition of same name and class [x
查看>>
JavaScript如何处理解析JSON数据详解
查看>>
Web渗透之Web利器合集——sqlmap和burpsuite连接
查看>>
Web渗透小案例——利用Metasploit(MSF)拿下Windows7
查看>>
【翻译自mos文章】运行utlpwdmg.sql之后报ORA-28003, ORA-20001, ORA-20002, ORA-20003, ORA-20004 错误
查看>>
Oracle GoldenGate (ogg) 11.2.1.0.20 是最后一个支持oracle db 10g的 ogg版本
查看>>