server {
listen 80 default_server;
server_name www.caipudq.cn caipudq.cn *.caipudq.cn;

root /mnt/www/tp5caipu/public;

location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php {
root /mnt/www/tp5caipu/public;
access_log /var/log/nginx/caipudq/access.log; #access_log属于ngx_http_log_module的设置,缺省level为info

error_log /var/log/nginx/caipudq/error.log; #error_log属于core module, 缺省的level是error
index index.php index.html index.htm; #由于是PHP类型的动态页面为主,所以把index.php放在前面效率会更高些

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;
try_files $uri $uri/ /index.php?$args; #普通php网站因为没有rewrite的话,这个不需要
}
include fastcgi_params;
error_page 404 /404.html;
location = /40x.html {
}

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

}

nginx 的一个conf配置的更多相关文章

  1. 解读:nginx的一个神秘配置worker_cpu_affinity

    今天在查看nginx的相关知识的时候发现了一个nginx之前不认识的配置:worker_cpu_affinity. nginx默认是没有开启利用多核cpu的配置的.需要通过增加worker_cpu_a ...

  2. 《亲测》nginx webscoket ssl conf配置示例

    非crt证书,用的pem,其中 http://localhost:5003 是你要转发到的站点网址 配置的就是 server { listen 80; server_name smarthome.yi ...

  3. 好坑吖,几乎GG,关于Nginx和supervisor的配置

    从没想过部署个站点居然这么费劲.这还是搞了好多回且环境都具备的前提一下. 不过问题还是挺刁钻的,下面详细说一下. 1.net core编译少dll文件问题 发布到服务器上执行dotnet FileSe ...

  4. 一个完整配置例nginx.conf(生产环境中使用)

    一个完整的nginx配置案例,生产环境 一个完整配置例(生产环境中使用) user nobody nobody; worker_processes 4; worker_rlimit_nofile 51 ...

  5. 配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7

    在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] nginx: configuration file /etc/nginx ...

  6. Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)

    Nginx 是一个轻量级高性能的 Web 服务器, 并发处理能力强, 消耗资源小, 无论是静态服务器还是网站, Nginx 表现更加出色, 作为 Apache 的补充和替代使用率越来越高,目前很多大型 ...

  7. linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)

    linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表 ...

  8. nginx的开机自启、server命令启动、nginx.conf配置

    1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/   ...

  9. [nginx]nginx的一个奇葩问题 500 Internal Server Error phpstudy2018 nginx虚拟主机配置 fastadmin常见问题处理

    [nginx]nginx的一个奇葩问题 500 Internal Server Error 解决方案 nginx 一直报500 Internal Server Error 错误,配置是通过phpstu ...

随机推荐

  1. 2021.9.14考试总结[NOIP模拟53]

    T1 ZYB和售货机 容易发现把每个物品都买成$1$是没有影响的. 然后考虑最后一个物品的方案,如果从$f_i$向$i$连边,发现每个点有一个出度多个入度,可以先默认每个物品都能买且最大获利,这样可以 ...

  2. 热身训练1 Game

    http://acm.hdu.edu.cn/showproblem.php?pid=5242 简要题意: 一棵树有n个节点,每个节点x有一个权值wi,我们要从根节点出发(不可回头),去收集每个节点的权 ...

  3. Qt字符编码小知识

    1.VS2010默认编码是GBK,Qt5的内置编码是utf-8,想要在VS2010及其以上版本,优雅的使用utf-8的字符编码需要 // Coding: UTF-8(BOM) #if defined( ...

  4. PriorityQueue(优先队列)

    PriorityQueue 翻译过来就是优先队列,本质是一个堆, 默认情况下堆顶每次都保留最小值,每插入一个元素,仍动态维护堆顶为最小值. PriorityQueue 一个基于优先级的无界优先级队列. ...

  5. GeoServer-Manager应用:java编码实现发布矢量数据或栅格数据至GeoServer

    目录 简介与下载 依赖 编码发布矢量数据 编码发布栅格数据 简介与下载 GeoServer-Manager是使用Java编写的面向GeoServer的客户端库,通过GeoServer的REST管理接口 ...

  6. evaluate-reverse-polist-notation leetcode C++

    Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*, ...

  7. popStar手机游戏机机对战程序

    DFS算,五分钟如果答案没有更新,那个解一般来说就很优了. #include <cstdio> #include <iostream> #include <string. ...

  8. for循环中创建线程执行问题

    先执行以一个简单的示例: static void Main(string[] args) { List<int> taskConsumes = new List<int>() ...

  9. LeetCode 114. 二叉树展开为链表 C++

    /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...

  10. 『学了就忘』Linux基础命令 — 35、网络中与其他机器通信的命令

    目录 1.write命令 2.wall命令 3.mail 命令 使用1:发送邮件 使用2:查看已经接收的邮件 使用3:发送文件内容 1.write命令 (1)write命令的基本信息 命令名称:wri ...