nginx vhosts rewrite 独立文件的方式出现
[root@web01 /]# cat /app/server/nginx/conf/nginx.conf user www www;
worker_processes ; error_log /app/log/nginx/error.log crit;
pid /app/server/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile ; events
{
use epoll;
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; #charset gb2312; server_names_hash_bucket_size ;
client_header_buffer_size 32k;
large_client_header_buffers 32k;
client_max_body_size 8m; sendfile on;
tcp_nopush on; keepalive_timeout ; tcp_nodelay on; fastcgi_connect_timeout ;
fastcgi_send_timeout ;
fastcgi_read_timeout ;
fastcgi_buffer_size 64k;
fastcgi_buffers 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k; gzip on;
gzip_min_length 1k;
gzip_buffers 16k;
gzip_http_version 1.0;
gzip_comp_level ;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zone crawler $binary_remote_addr 10m;
log_format '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include /app/server/nginx/conf/vhosts/*.conf;
}
nginx vhosts 配置文件独立文件存在
注意:添加第56行内容
[root@web01 /]# cat /app/server/nginx/conf/vhosts/default.conf
server {
listen default_server;
server_name web01.espressos.cn;
root /app/www;
index index.php index.html index.htm;
location ^~ /images/ {
alias /var/tmp/images/;
valid_referers none blocked *.espressos.cn *.qq.com *.baidu.com;
if ($invalid_referer) {
rewrite ^/ http://192.168.1.25/404.jpg;
} }
location ~* \.(gif|jpg|png|swf|flv)$ {
expires 30d;
}
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log /app/log/nginx/access/default.log;
include /app/server/nginx/conf/rewrite/default.conf;#加上这句话
}
[root@web01 /]# file /app/server/nginx/conf/rewrite/default.conf
/app/server/nginx/conf/rewrite/default.conf: ASCII text
nginx vhosts rewrite 独立文件的方式出现的更多相关文章
- nginx负载均衡(5种方式)、rewrite重写规则及多server反代配置梳理
Nginx除了可以用作web服务器外,他还可以用来做高性能的反向代理服务器,它能提供稳定高效的负载均衡解决方案.nginx可以用轮询.IP哈希.URL哈希等方式调度后端服务器,同时也能提供健康检查功能 ...
- (转)nginx负载均衡(5种方式)、rewrite重写规则及多server反代配置梳理
Nginx除了可以用作web服务器外,他还可以用来做高性能的反向代理服务器,它能提供稳定高效的负载均衡解决方案.nginx可以用轮询.IP哈希.URL哈希等方式调度后端服务器,同时也能提供健康检查功能 ...
- 使用nginx的rewrite实现代理指定文件夹命令方法
使用nginx的rewrite实现代理指定文件夹命令方法 使用nginx代理Tomcat,Tomcat公布web的时候通常都是带着项目名称的. 比方项目名称为"aven".那么公布 ...
- Nginx的Rewrite规则与实例
通过Rewrite规则可以实现规范的URL.根据变量来做URL转向及选择配置,用好Rewrite有时起到事半功倍的效果. 语法 Nginx的Rewrite相比Apache的要好理解很多,主要使用指令有 ...
- nginx之rewrite相关功能
Nginx Rewrite相关功能 Nginx服务器利用ngx_http_rewrite_module 模块解析和处理rewrite请求,此功能依靠 PCRE(perl compatible regu ...
- nginx 缓存,大文件分片请求方法
实现的途径:expire cache-control 更新缓存的机制 如何校验本地缓存是否过期 expires cache-control(max-age)如果超期,说明失效 然后进行etag是否过期 ...
- Nginx 实现 Rewrite 跳转
文章原创于公众号:程序猿周先森.本平台不定时更新,喜欢我的文章,欢迎关注我的微信公众号. 上一篇文章对Nginx的Location配置进行了讲解,本篇主要对于Nginx中的Rewrite跳转进行讲解. ...
- Nginx实现rewrite重写
目录 Rewrite基本概述 Rewrite标记Flag Rewrite规则实践 Rewrite场景示例 Rewrite规则补充 rewrite优先级实战 Rewrite基本概述 什么是rewrite ...
- nginx 配置rewrite 笔记
nginx 配置rewrite笔记: 通过下面的示例来说明一下,1. 先说说location : location 表示匹配传入的url地址,其中配置符有多种,各种情况的意义不一样: location ...
随机推荐
- threadlocal彻底理解,深刻
本文转自http://blog.csdn.net/huachao1001/article/details/51970237 ThreadLocal的使用相信大家都比较熟悉,但是ThreadLocal内 ...
- Android客户端面试题集锦
声明:本文问题来自但不限于Xoper.ducky大牛的面试总结,网址:http://www.nowcoder.com/discuss/3043,欢迎各位进行补充 JAVA SE 1. 九种基本数据类型 ...
- KEIL、uVision、RealView、MDK、KEIL C51之间比较
KEIL uVision,KEIL MDK,KEIL For ARM,RealView MDK,KEIL C51,KEIL C166,KEIL C251 从接触MCS-51单片机开始,我们就知道有一个 ...
- RRGGBBAA或者RRGGBB转换成rgba()
//十六进制颜色值的正则表达式 var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; /*16进制颜色转为RGB格式*/ var colorRgb = fun ...
- Android疑难杂症之KillProcess 和System.exit 无效
以下所讲,浓缩在 https://github.com/wytings/CrashDemo 首先就这个名字来说,kill了process 或者 system.exit确实已经把APP杀掉了,特别是当你 ...
- xss测试用例小结
<script>alert("跨站")</script> (最常用) <img scr=javascript:alert("跨站" ...
- TensorFlow------读取CSV文件实例
TensorFlow之读取CSV文件实例: import tensorflow as tf import os def csvread(filelist): ''' 读取CSV文件 :param fi ...
- C#++c1FlexGrid+帮助文档09
摘自: http://3y.uu456.com/bp-e2746s16s2d380eb62946d27-1.html C#:c1FlexGrid帮助文档:Value-MappedLists(值映射列表 ...
- 【Linux】apt-get install 怎么阻止弹出框,使用脚本默认自动安装?
You can do a couple of things for avoiding this. Setting the DEBIAN_FRONTEND variable to noninteract ...
- 使用jsmin压缩javascript脚本
官方地址:http://www.crockford.com/javascript/jsmin.html 点击页下方的”zip file containing an MS-DOS.exe file“下载 ...