--prefix=/opt/app/nginx --with-rtsig_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --add-module=/data/software/nginx/nginx-accesskey-2.0.3 --add-module=/data/software/nginx/ngx_cache_purge-1.2
--add-module=/data/software/nginx/nginx-accesskey-2.0.3 是一个第三方模块,用于防盗链
--add-module=/data/software/nginx/ngx_cache_purge-1.2 第三方模块,用于缓存系统
配置参考:http://comtv.blog.51cto.com/17037/406066 nginx+tomcat 负载均衡缓存服务器集群
http://www.yongri.info/linux/nginxconfigwebcache.html Nginx的web缓存配置
http://www.linuxpk.com/58314.html nginx rewrite伪静态配置参数详细说明
gzip_proxied any; 前端是squid的情况下要加此参数,否则squid上不缓存gzip文件
------------------------------------------
不使用purge时原来nginx也支持简单的缓存方案,
location / {
root /home/html/;
proxy_store on;
proxy_set_header Accept-Encoding ”;
proxy_temp_path /home/tmp;
if ( !-f $request_filename )
{
proxy_pass http://www.inginx.com/;
}
}
3、基于memcached的缓存
nginx对memcached有所支持,但是功能并不是特别之强,性能上还是非常之优秀。
location /mem/ {
if ( $uri ~ “^/mem/([0-9A-Za-z_]*)$” )
{
set $memcached_key “$1″;
memcached_pass 192.168.1.2:11211;
}
expires 70;
}
4.rewrite 的一些规则
rewrite ^ http://www.xxx.com$request_uri?; //可以放置在location 或server 目录下
参考文章:http://www.ccvita.com/348.html Nginx下Discuz!的Rewrite
5.proxy pass
location /blah/ {
proxy_pass http://backend/boom/;
}
and request "/blah/something" your backend will see "/boom/something".
Without uri component (proxy_pass http://mongrel
) uri will be
transfered to backend as is, i.e. for
location /blah/ {
proxy_pass http://backend;
}
and request "/blah/something" your backend will see "/blah/something".
具体参考:http://typengine.com/content/nginx%E9%85%8D%E7%BD%AE%E7%BC%93%E5%AD%98cache%E7%9A%845%E7%A7%8D%E6%96%B9%E6%A1%88 nginx 5种缓存方案
分享到:
相关推荐
网络上很难找到非常详细的关于nginx配置https的全流程,大多都是一小段,要么缺A要么缺B。 本文档通过真实的实践经验,从安装OpenSSL和Nginx,到利用openssl生成证书,配置nginx的https(包括配置http请求转发到...
三、Nginx配置安全头 在上面的配置文件中,我们使用了add_header指令来添加Content-Security-Policy头,以便升级不安全的请求。这可以防止攻击者inject恶意脚本来攻击网站。 四、Nginx配置错误页面 在上面的配置...
Nginx配置文件 nginx.conf 详解doc文档
Nginx配置多个service 多个访问路径 找到conf/nginx.conf修改配置文件 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid ...
nginx配置+https
nginx配置 +负载均衡+https协议 完整的配置以及nginx 启动 停止 重新加载
windows下 php+nginx配置详解,经整理修改测试通过,希望和大家一起分享!
nginx配置 nginx配置文件参考 nginx配置文件参考
项目打包运行dist以及nginx配置
主要介绍了Nginx配置SSL自签名证书的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
liunx nodejs+nginx配置收藏版liunx nodejs+nginx配置收藏版
nginx 配置跨域不生效 如下配置 server { listen 80; server_name localhost; # 接口转发 location /api/ { # 允许请求地址跨域 * 做为通配符 add_header 'Access-Control-Allow-Origin' '*'; # 设置请求...
Windows下Nginx配置SSL实现Https访问(包含证书生成)
nginx配置多个静态资源 本文将详细介绍nginx配置多个静态资源的知识点,从基本概念到配置实践,涵盖了nginx配置文件的各个组件和指令。 nginx配置文件结构 nginx配置文件主要由以下几个部分组成: * main块:...
Nginx配置ThinkPHP框架 ...............
nginx配置多个conf。nginx.conf和conf.d,
Nginx配置文件——一级域名、二级域名
squid和nginx配置正向代理访问API接口
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 error_log /var/log/...
对nginx进行详细的访问数量,日志请求头配置,多域名分发,反向代理等配置,可以对手机访问进行判断重定向手机域名