打开Nginx配置文件

输入 vim etc/nginx/nginx.conf

找到配置扩展文件:

打开配置文件配置如下环境:

server {

listen       80;

server_name  server.baishi360.cn;

#charset koi8-r;

#access_log  /var/log/nginx/host.access.log  main;

location / {

root   /usr/share/nginx/html;

index  index.php index.html index.htm;

}

#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   /usr/share/nginx/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$ {

root           html;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

提示:“File Not Fond ”时改成绝对路:

fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$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;

#}

}

 

Nginx配置PHP环境支持的更多相关文章

  1. IIS8 使用FastCGI配置PHP环境支持 过程详解

    平时帮朋友们配置过一些PHP环境的服务器,但是一直使用的都是Apache HTTP+PHP,今天呢,我吧IIS+PHP配置方式给大家发一下下~呵呵. 在这里,我使用的是FastCGI模块映射的方式配置 ...

  2. nginx配置反向代理支持session

    Nginx反向代理tomcat,很是方便,但是也有些细节的问题需要注意:今天遇到了这样一个问题,tomcat中路径“host/web1”,nginx中直接“host/”代理,这时候session就无法 ...

  3. Nginx配置跨域支持功能

    跨域是前端开发中经常会遇到的问题,前端调用后台服务时,通常会遇到 No 'Access-Control-Allow-Origin' header is present on the requested ...

  4. nginx 配置虚拟主机(支持php)

    配置步骤: 1.在nginx安装目录下,找到nginx.conf所在文件夹,新建vhost文件夹 2.在nginx.conf http{} 末端加入 include vhost/*.conf; 3.进 ...

  5. nginx配置使其支持thinkphp的pathinfo模式

    #user root;#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log noti ...

  6. Nginx配置反向代理支持WebSocket

    http { #WebSocket代理配置 map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { ...

  7. windows 下nginx配置ssl https支持

    本文适合正式上线的配置,购买来的证书 私钥*.key文件需要先去掉密码 openssl rsa -in old.key -out new.key

  8. centos6.8 环境一键安装包 nginx配置thinkphp5

    ---恢复内容开始--- lnmp1.4 一键安装包 nginx配置thinkphp5     环境:Nginx1.12.1  PHP5.6  Coentos6.8 修改网站配置文件      ser ...

  9. Windos环境用Nginx配置反向代理和负载均衡

    Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...

随机推荐

  1. PHP随机生成不重复的8位卡号(数字)和卡密(字符串)

    一.生成不重复的随机数字,可自定义长度(最多支持10位数) /** * 生成不重复的随机数字(不能超过10位数,否则while循环陷入死循环) * @param int $start 需要生成的数字开 ...

  2. PHP7.1以上版本 count()报错

    报错信息如下: count(): Parameter must be an array or an object that implements Countable (View: D:\fookusy ...

  3. SSH出错

    [root@node01 ~]# ssh node02 ssh_exchange_identification: Connection closed by remote host 修改连接数无效 [r ...

  4. NORDIC内核ARM蓝牙芯片NRF51802/NRF51822

    Nordic  nRF51 系列的IC 和协议堆栈对内存大小.封装类型.接口.周边产品及无线连接提供更多选择. 关于 nRF51 系列 多协议 2.4GHz 射频收发器拥有高性能.超低功耗以及灵活性等 ...

  5. poi提取docx中的文字和图片

    package com.fry.poiDemo.dao; import java.io.File; import java.io.FileInputStream; import java.io.Fil ...

  6. python requests方法post请求json格式处理

    方法如下: import requestsimport json data = {    'a': 123,    'b': 456} ## headers中添加上content-type这个参数,指 ...

  7. 15. Django连接Mysql数据库

    安装PyMySQL,打开cmd, pip install PyMySQL 在.../blog/init.py 目录下添加: import pymysql pymysql.install_as_MySQ ...

  8. PAT_A1104#Sum of Number Segments

    Source: PAT A1104 Sum of Number Segments (20 分) Description: Given a sequence of positive numbers, a ...

  9. java 重新学习 (三)

    一.静态初始化块和声明静态成员变量时所指定的初始化值都是该类的初始化代码,他们的执行顺序与源程序中的排列顺序相同. static int a = 9 ; static{ a = 6; } public ...

  10. java算法汇总(一)

    1.有一对兔子,从出生后第三个月起每个月都生一对兔子,小兔子涨到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月兔子总数为多少? 程序分析:斐波那契数列 0.1.1.2.3.5.8.13.21 ...