配置时注意红色部分

server {
  listen 8888 default_server;
  #listen [::]:80 default_server;
  server_name _;
  root /usr/share/nginx/html;

  # Load configuration files for the default server block.
  include /etc/nginx/default.d/*.conf;

  location / {
    # root /usr/share/nginx/html;
    index index.html index.htm index.php;
  }

  location ~ \.php/?.*$ {
    root /usr/share/nginx/html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    #加载Nginx默认"服务器环境变量"配置
    include fastcgi.conf;

    #设置PATH_INFO并改写SCRIPT_FILENAME,SCRIPT_NAME服务器环境变量
    set $fastcgi_script_name2 $fastcgi_script_name;
    if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
      set $fastcgi_script_name2 $1;
      set $path_info $2;
    }
    fastcgi_param PATH_INFO $path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
  }

  error_page 404 /404.html;
  location = /40x.html {
  }

  error_page 500 502 503 504 /50x.html;
  location = /50x.html {
  }

}

nginx配置ThinkPHP配置的更多相关文章

  1. nginx+thinkPhp配置虚拟主机和伪静态规则重写

    /usr/local/nginx/conf/nginx.conf 进行配置 server    {        listen 80 default_server;        #listen [: ...

  2. 以实际的WebGIS例子探讨Nginx的简单配置

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.背景 以实际项目中的一个例子来详细讲解Nginx中的一般配置,其中涉 ...

  3. nginx + SSL优化配置

    nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...

  4. nginx安装与配置

    一.在线安装 ubuntu 安装 sudo apt-get install nginx 安装后文件结构为: 配置文件:/etc/nginx ,并且每台虚拟主机已经安排在 /etc/nginx/site ...

  5. windows下nginx安装、配置与使用(转载)

    目前国内各大门户网站已经部署了Nginx,如新浪.网易.腾讯等:国内几个重要的视频分享网站也部署了Nginx,如六房间.酷6等.新近发现Nginx 技术在国内日趋火热,越来越多的网站开始部署Nginx ...

  6. Nginx服务器之 Nginx的基本配置

    本文使用 Linux centos系统 一.Nginx虚拟主机的配置 虚拟主机:通常情况下,为了使每个服务器可以供更多用户使用,可以将一个服务器分为很多虚拟的子服务器,每个子服务器都是互相独立的.这些 ...

  7. 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定

    阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...

  8. nginx入门篇----nginx服务器基础配置

    1.nginx.conf文件结构...                         #全局块  events{  ...  }  http                      #http块{ ...

  9. 高流量站点NGINX与PHP-fpm配置优化(译)

    使用Nginx搭配PHP已有7年的这份经历让我们学会如何为高流量站点优化NGINX和PHP-fpm配置. 以下正是这方面的一些提示和建议: 1. 将TCP切换为UNIX域套接字 UNIX域套接字相比T ...

随机推荐

  1. oc调javascript方法(evaluateJavaScript:)&&js给oc发通知

    在ios8中引入了WKWebView控件,通过在头文件引用 #import <WebKit/WebKit.h>来使用该控件, 这个控件与oc的原生控件uiwebview很相似,它更方便oc ...

  2. CTF之文件包含的猥琐思路

    From: i春秋 百度杯”CTF 一: <?php include "flag.php"; //包含flag.php这个文件 $a = @$_REQUEST['hello' ...

  3. python - hadoop,mapreduce demo

    Hadoop,mapreduce 介绍 59888745@qq.com 大数据工程师是在Linux系统下搭建Hadoop生态系统(cloudera是最大的输出者类似于Linux的红帽), 把用户的交易 ...

  4. ado ole方式访问access的两种方式

    OleDbConnection Connection = new OleDbConnection(); OleDbDataAdapter adapter = null; //ConnectiongSt ...

  5. 最美应用API接口分析

    最美应用API接口分析html, body {overflow-x: initial !important;}.CodeMirror { height: auto; } .CodeMirror-scr ...

  6. hive中窗口分析函数

    分组统计 1. groups sets(field1,field2,field3, (field1,field2)) 样例如下: select dt,tenantCode,nvl(platform,' ...

  7. mssqlserver获取表说明和行数

    SELECT a.*,t.rows FROM ( ) ) AS a left join (, )) ) AS t ON a.表名=t.name

  8. 百度地图Api进阶教程-点聚合9.html

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  9. lr11.0负载测试 real-world schedule 与basic schedule的区别是什么

    real-world schedule 是真实场景模式  可以通过增加ACTION来增加多个用户 basic schedule 是我们以前用的 经典模式  只能设置一次负载的上升和下降

  10. ViewPager自定义选项卡

    转自:http://www.open-open.com/lib/view/open1352621601262.html