随笔分类 - Nginx
摘要:下面四种情况分别用http://192.168.1.100/proxy/test.html 进行访问。第一种:location /proxy/ {proxy_pass http://127.0.0.1:81/;}会被代理到http://127.0.0.1:81/test.html 这个url第二咱(相对于第一种,最后少一个 /)location /proxy/ {proxy_pass http://127.0.0.1:81;}会被代理到http://127.0.0.1:81/proxy/test.html 这个url第三种:location /proxy/ {proxy_pass http:/
阅读全文
摘要:1. URL链接出现非法链接 (如 */./Play/show/id/349281);2. CDN接收未知Referer处理失效(目前搜索引擎的状态码为499);3. CDN抓取服务器 Cache-Control, Last-Modified(影响CDN的抓取)4. CDN会同步缓存Cookie内容,造成用户间差异进而回源访问;5. CDN部分节点服务器出现异常;6. 源站过慢造成CDN节点抓取不到数据,未进行策略回避,进行造成持续阻塞;服务器处理:+ 关闭长连接[sysctl.conf];+ 打开FastCGI(PHP-FPM) 操作设置 [request_terminate_timeout
阅读全文
摘要:gzip决定是否开启gzip模块param:on|offexample:gzip on;gzip_buffers设置gzip申请内存的大小,其作用是按块大小的倍数申请内存空间param1:intparam2:int(k) 后面单位是kexample: gzip_buffers 4 8k;gzip_comp_level设置gzip压缩等级,等级越底压缩速度越快文件压缩比越小,反之速度越慢文件压缩比越大param:1-9example:gzip_com_level 1;gzip_min_length当返回内容大于此值时才会使用gzip进行压缩,以K为单位,当值为0时,所有页面都进行压缩param:
阅读全文
摘要:目 录一、 Nginx 基础知识二、 Nginx 安装及调试三、 Nginx Rewrite四、 Nginx Redirect五、 Nginx 目录自动加斜线:六、 Nginx Location七、 Nginx expires八、 Nginx 防盗链九、 Nginx 访问控制十、 Nginx日志处理十一、 Nginx Cache十二、 Nginx负载均衡十三、 Nginx简单优化 十四、 如何构建高性能的LEMP环境十五、 Nginx服务监控十六、 常见问题与错误处理.十七、 相关资源下载【前言】:编写此技术指南在于推广普及NGINX在国内的使用,更方便的帮助大...
阅读全文
摘要:源码安装nginx就面临这样的麻烦,不能使用service nginx restart 来重启nginx,没办法只能重新加载下nginx.#/usr/local/nginx/sbin/nginx -s reload
阅读全文
摘要:Nginx 有几种缓存动态网站,详情请看:nginx缓存cache的5种方案。我的需求是保存动态页面为静态文件即可。然后写个脚本定时删除超过给定时间的html文件。这样可以减轻动态网站的压力。使用 nginx 的 proxy_store 模块,匹配:http{server{listen80;server_nametest.com;access_loglogs/test.access.logmain;gzipon;location/{root/home/www/cache;proxy_storeon;proxy_set_headerAccept-Encoding'';proxy_
阅读全文
摘要:据说 Nginx 做负载均衡不错,恩拿来学习配置下。先安装:wgethttp://sysoev.ru/nginx/nginx-0.6.35.tar.gztarzxvfnginx-0.6.35.tar.gzcdnginx-0.6.35./configuremakemakeinstall安装时出现下面的错误:Configuration summary+ PCRE library is not found+ OpenSSL library is not used+ md5 library is not used+ sha1 library is not used+ using system zlib
阅读全文
摘要:VPS 上安装了 nginx。用多个子域名,每个子域名到不同的目录。如:http{server{listen80;server_namea.com;access_loglogs/a.access.logmain;server_name_in_redirectoff;location/{indexindex.html;root/home/www/host_a/;}}server{listen80;server_nameb.com;access_loglogs/b.access.logmain;server_name_in_redirectoff;location/{indexindex.html
阅读全文
浙公网安备 33010602011771号