打开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. 用idea将本地项目提交到gitlab上

    提交的前提是你必须有gitlab的地址 以下是将本地代码提交到gitlab上 在idea的菜单项选择 VCS>Import into Version Control>Create Git ...

  2. 处理字符串的一些js/jq方法(去除HTML,去除空格,计算真实长度,截取中英文字符)

    去除html标签: function del_html_tags(str) { var words = ''; words = str.replace(/<[^>]+>/g,&quo ...

  3. TCP三次握手过程和四次释放

    TCP是面向连接的协议 客户端发送 SYN包,和随机数SEQ.此时客户端是SYN_SENT状态. 服务器返回SYN+ACK,和随机数SEQ, rwnd是告诉客户端我可以接收多少字节.此时服务器端是SY ...

  4. linux(一)vi和vim

    vi 多模式文本编辑器 多模式产生的原因 四种模式 正常模式 插入模式 命令模式 可视模式 vi man vi vim vim正常模式 直接vim回车,或vim空格文件名回车 i进入插入模式 I(sh ...

  5. 【LeetCode 37】解数独

    题目链接 [题解] 回溯法搞一下. 用set和数组下标判重. [代码] class Solution { public: set<int> myset[9]; int hang[9][10 ...

  6. sql中简单的触发器功能

    触发器分为DML触发器和DDL触发器DML触发器包含After触发器,执行insert update delete语句后会触发after触发器,会事务回滚DML触发器还包含instead of触发器, ...

  7. Android学习--apk打包过程

    1. 使用aapt工具,给所有的res目录下的资源文件生成对应的id,id会被放进R.java文件中 2. JavaC编译器,将所有Java文件转换为Class文件,其中,内部类会分别生成.class ...

  8. IDEA的骚操作

    1.var声明 "jack".var ==>final String name = "jack"; 2.null判空 user.null==>if( ...

  9. flask中app.py: error: invalid choice: 'insert'........的问题

    在flask中,分为两种操作方式,url指向函数或者终端指向函数,最终目的就是让函数执行,触发方式不同.终端执行更加安全, 另外如果在终端执行的时候出现 : 就是说明 insert 没有在@ mana ...

  10. 个人笔记 - MATLAB

    1.教程 2.基本知识 2.1 帮助文档设置成中文:链接1 2.2 多行注释: 链接1 2.3 MATLAB基本数据类型: 链接1  链接2 2.4 matlab中的 ndims(a).length( ...