打开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. php7类型约束的意义

    在PHP7之前,函数和类方法不需要声明变量类型,任何数据都可以被传递和返回,导致几乎大部分的调用操作都要判断返回的数据类型是否合格. 为了解决这个问题,PHP7引入了类型声明. 目前有两类变量可以声明 ...

  2. DMA实验总结

    一.RCC设置 没什么好写的之前USART的基本一样 /************************************************************************ ...

  3. POJ 2240 Arbitrage (spfa判环)

    Arbitrage Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of ...

  4. vuedraggable 实现拖动数据改变

    // 引入组件 import Draggable from 'vuedraggable' // 使用组件 DragList 为自己封装好的组件 注意一定要使用vue的sync <DragList ...

  5. 埋坑一: vue中子组件调用兄弟组件方法

    小计: 开发中遇到子组件需要调用兄弟组件中的方法,如下写个小demo记录下心得,如果你有好的方法,请到评论区域指教 父组件示例代码: 组件功能解析: 通过$emit获取子组件事件,通过$ref调用子组 ...

  6. 【Tomcat】2.配置Tomcat服务器端口和HTTPS

    1.修改XML配置文件 找到Tomcat安装目录下的conf文件夹,打开server.xml文件(可以用笔记本打开) 其中有几行代码如下 <Server port="8005" ...

  7. 100、TensorFlow实现FFM Field-awared FM模型

    ''' Created on 2017年11月15日 @author: weizhen ''' import tensorflow as tf import pandas as pd import n ...

  8. 5. 使用grafana模板

    我们刚刚配置的Dashboard还是有点简陋,为了界面美观,这里我们这里使用一些模板 1.使用node_exporter模板 去grafana官网下载模板,点击Download,如下所示 2.导入模板 ...

  9. pat甲级题目1001 A+B Format详解

    pat1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits ...

  10. PAT甲级——A1141 PATRankingofInstitution【25】

    A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the ...