nginx子配置文件实例
[root@bogon conf.d]# cat /etc/nginx/conf.d/test6.conf
server
{
listen 8085;
server_name 192.168.0.204; #填写 ip 或者域名
index index.html index.htm default.html index.php;
root /var/www/www.test.com/; if (!-e $request_filename) { #访问路径的文件不存在则重写URL转交给ThinkPHP处理
rewrite ^/(.*)$ /index.php/$1 last;
break;
} location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf; #注意这个include 这个配置文件是nginx自带的,一定要有 #下面这 8 行统称为fastcgi_params的配置,nginx也有自带的fastcgi_params,但是报错,按照下面的就行
#宝塔面板里面 直接把这 8 行写到了一个pathinfo.conf文件里面,用一句话include pathinfo.conf代替 set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info; } location /status {
stub_status on;
access_log off;
} location /favicon.ico {
root html;
} location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 15d;
} location ~ .*\.(js|css)?$
{
expires 6h;
}
access_log /var/www/ceshi.access.log access;
error_log /var/www/ceshi.error.log;
}
nginx子配置文件实例的更多相关文章
- nginx主配置文件实例
1.修改配置文件 重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户 [root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf -rw- ...
- nginx 代理配置文件实例
安装NGINX前要先安装PCRE正则表达式库: ./configure --prefix=/usr/local/pcre 出现以下错误 (一般./configure即可, 笔者这里是直接./conf ...
- Nginx配置配置文件详解
文章目录 配置文件 nginx.conf配置文件详解 用于调试.定位问题的配置参数 正常运行必备的配置参数 优化性能的配置参数 事件相关配置 Fastcgi相关配置参数 常需要调整的参数 nginx作 ...
- nginx默认配置文件解释
nginx默认配置文件 nginx.conf 介绍: 全局配置 user nginx; 设置nginx服务的系统使用用户 worker_processes 1; 工作进程数(建议和CPU核心数保持 ...
- Nginx+Tomcat多实例及负载均衡配置
Nginx+Tomcat多实例及负载均衡配置 采用nginx的反向代理负载均衡功能,配合后端的tomcat多实例来实现tomcat WEB服务的负载均衡 01 安装nginx服务 安装所需的pcre库 ...
- Keepalived+Nginx高可用实例
Keepalived+Nginx高可用实例 注意事项: 1.VIP不需要在服务器网络配置文件中配置. 2.nginx主不可用时,需要kill掉nginx主的keepalived服务,这样才可以实现VI ...
- Apache源码包安装和子配置文件介绍--update.2014-12-5
安装apache: 官网:http://httpd.apache.org/download.cgi#apache24 1.wget http://mirror.bit.edu.cn/apache//h ...
- Nginx的配置文件(nginx.conf)解析和领读官网
步骤一:vi nginx.conf配置文件,参考本博文的最下面总结,自行去设置 最后nginx.conf内容为 步骤二:每次修改了nginx.conf配置文件后,都要reload下. index.ht ...
- [原]生产环境下的nginx.conf配置文件(多虚拟主机)
[原]生产环境下的nginx.conf配置文件(多虚拟主机) 2013-12-27阅读110 评论0 我的生产环境下的nginx.conf配置文件,做了虚拟主机设置的,大家可以根据需求更改,下载即可在 ...
随机推荐
- Share:《THE ULTIMATE XSS PROTECTION CHEATSHEET FOR DEVELOPERS》
Ajin Abraham(OWASP Xenotix XSS Exploit Framework的作者哦!)编写的<THE ULTIMATE XSS PROTECTION CHEATSHEET ...
- Linux vim替换命令
#替换每一行的第一个a:%s/a/b/#全部替换:%s/a/b/g#替换/时需要转义"\/"
- Restricting Input in HTML Textboxes to Numeric Values
Ok, here’s a fairly basic one – how to force a textbox to accept only numeric input. Somebody asked ...
- MHA介绍和基础、原理、架构、工具介绍
一.MHA简介 软件简介 MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Facebo ...
- java读取word文档,提取标题和内容
使用的工具为poi,需要导入的依赖如下 <dependency> <groupId>org.apache.poi</groupId> <artifactId& ...
- js 创建节点 以及 节点属性 删除节点
case 'copy': var B1 = document.getElementById("B1"); //获得B1下的html文本 var copy_dom = documen ...
- Centos 下硬盘分区的最佳方案
Centos7从零开始]Centos 下硬盘分区的最佳方案 2016年12月25日 10:09:02 浮華的滄桑 阅读数 41971 在对硬盘进行分区前,应该先弄清楚计算机担负的工作及硬盘的容量有 ...
- Codeforces Round #325 (Div. 2) A. Alena's Schedule 暴力枚举 字符串
A. Alena's Schedule time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Spring的jsp标签库
1,主要有两个 一个用于渲染HTML表单标签, 这些标签会绑定model中的某个属性 另一个包换了一些工具类标签 2,将表单绑定到模型上 包含了14个标签,海报一个人为用户展现错误的标签,它会将错误信 ...
- Linux常用命令及操作(第二弹)
Ctrl l清屏 Ctrl d关闭终端 Ctrl Alt T打开终端 pwd 查看当前的目录 Shift Ctrl C复制 Shift Ctrl V粘贴 Shift Ctrl N打开新的终端 F11 ...