Docker实现PHP开发环境 By duncan21Posted on 2022 年 1 月 4 日2022 年 3 月 2 日Posted in LinuxTagged docker, mysql, nginx, php8, redisNo Comments on Docker实现PHP开发环境 环境准备: #docker的版本 [root@10-10-20-236 /]# docker info|grep Version Server Version: 20.10.8 Cgrou[……] 阅读全文 Read More
nginx 启动脚本 By duncan21Posted on 2021 年 10 月 22 日Posted in ShellTagged nginxNo Comments on nginx 启动脚本 完整的脚本: [root@li1079-183 html]# cat /etc/init.d/nginx #!/bin/bash # chkconfig: - 30 21 # descrip[......]阅读全文 Read More
[转]How to Enable WebP on Nginx Servers By duncan21Posted on 2021 年 5 月 3 日2021 年 5 月 3 日Posted in LinuxTagged nginx, webpNo Comments on [转]How to Enable WebP on Nginx Servers WebP is an image format developed by Google that can optimize image file size by 60-80% without losi[……] 阅读全文 Read More
Nginx实现后端节点健康检查功能 By duncan21Posted on 2021 年 4 月 10 日2021 年 4 月 10 日Posted in LinuxTagged check, nginx, upstream, 健康检查No Comments on Nginx实现后端节点健康检查功能 目前,作为代理服务器nginx对后端节点健康检查的方式主要有3种,这里列出: 1,ngx_http_proxy_module 模块和ngx_http_upstream_module模块(nginx自[……] 阅读全文 Read More
禁止搜索引擎抓取和收录 By duncan21Posted on 2021 年 3 月 22 日2021 年 3 月 23 日Posted in LinuxTagged nginx, 抓取No Comments on 禁止搜索引擎抓取和收录 有时候我们会遇到这样的需求:不要让这个网站被收录。禁止收录? 方法一:通过<meta>标签实现禁止搜索引擎索引: <meta name="robots" content=[......]阅读全文 Read More
常用的分析nginx日志的命令 By duncan21Posted on 2017 年 9 月 5 日Posted in LinuxTagged nginx, 日志No Comments on 常用的分析nginx日志的命令 awk ‘$9~/503/’ m.log>503.log ?取日志m.log中的503,并重定向到文件503.log awk ‘$9 !~ /200/’ ? 取日志m.log中的不是200[……] 阅读全文 Read More
工作中nginx的重写案例记录 By duncan21Posted on 2016 年 10 月 31 日Posted in LinuxTagged 301, nginx, rewriteNo Comments on 工作中nginx的重写案例记录 需求: 因为运营的需求,需要将所有网站的目录test1的访问请求跳转到tes2, 如何将abc.com/test1/1.html ?301跳转到#abc.com/test2/1.html([……] 阅读全文 Read More
nginx的安全配置 By duncan21Posted on 2016 年 9 月 6 日2016 年 9 月 6 日Posted in LinuxTagged nginx, phpNo Comments on nginx的安全配置 网站的目录结构: 2 directories, 7 files 需求: 1.网站根目录下,只允许访问index.php,其他任何php文件不得访问。即不能访问1.php和te[……] 阅读全文 Read More
[转]Haproxy与Nginx的优缺点总结 By duncan21Posted on 2015 年 12 月 23 日Posted in LinuxTagged haproxy, nginx Nginx的优点: 1、工作在OSI第7层,可以针对http应用做一些分流的策略。比如针对域名、目录结构。它的正则比HAProxy更为强大和灵活; 2、Nginx对网络的依赖非常小,理论上能pin[……] 阅读全文 Read More