
Nginx
蚊子爱喝水
欢迎来到我的博客!我是一名热衷于PHP开发的程序员。在这个博客里,我将分享我在PHP开发过程中的经验、技巧、见解和学习心得。无论您是PHP初学者还是经验丰富的开发者,我相信您都能在这里找到有价值的内容。
展开
-
nginx 如何对用户屏蔽网站首页但是对蜘蛛开放
nginx如何对用户屏蔽网站首页但是对蜘蛛开放原创 2024-04-11 10:21:37 · 370 阅读 · 0 评论 -
nginx日志记录访问全地址
nginx日志记录访问全地址原创 2022-11-29 10:38:26 · 3285 阅读 · 0 评论 -
nginx分割指定目录下的日志文件保留7天
nginx分割指定目录下的日志文件保留7天原创 2022-09-16 16:44:10 · 2237 阅读 · 0 评论 -
nginx日志切割
直接上代码:vim cut_nginx_logs.sh#!/bin/bash#function:cut nginx log files for lnmp v0.5 and v0.6#author: http://lnmp.org#设置nginx日志文件目录路径log_files_path="/home/wwwlogs/"#日志文件将会存放到/home/wwwlogs/年/月/日志文件名_年月日.loglog_files_dir=${log_files_path}$(date -d.原创 2020-11-05 14:22:37 · 160 阅读 · 0 评论 -
Centos安装php7 zip 扩展
安装之前先检车服务器是否 安装了 libzip (安装libzip 需要 cmke)最新版本请参考官网:https://nih.at/libzip/yum install -y cmakewget https://libzip.org/download/libzip-1.2.0.tar.gztar -zxvf libzip-1.2.0.tar.gzcd libzip-1.2.0.tar.gzmkdir build && cd build && /usr/..原创 2020-11-04 15:59:00 · 530 阅读 · 0 评论 -
lua+nginx实现黑名单禁止访问
可以使用基于 Nginx 与 Lua 的高性能 Web 平台OpenResty。OpenResty地址安装简单,略去。 # 分配内存 lua_shared_dict ip_blacklist 1m; server { listen 80; server_name localhost; root E...转载 2019-11-19 11:46:56 · 1005 阅读 · 0 评论 -
nginx配置文件中root和alias的区别
nginx配置文件中root和alias的区别概述root和alias都用于指定请求URL的映射路径区别root指向的映射地址需要通过root映射地址+location地址访问。alias指向的映射路径便是资源的根目录,只能在location中使用。[root]语法:root path默认值:root html配置段:http、server、location、if...原创 2019-10-30 14:49:31 · 512 阅读 · 0 评论 -
ngx_http_core_module 模块变量
参数名称 注释 $arg_PARAMETER HTTP 请求中某个参数的值,如/index.php?site=www.ysl.com,可以用$arg_site 取得 www.ysl.com 这个值 $args HTTP 请求中的完整参数。例如,在请求/index.php?width=400&height=200 中,$args 表示字符串 width=400&am...原创 2019-10-31 09:58:47 · 164 阅读 · 0 评论 -
lnmp出现502后 自动重启lnmp的办法
需要确保系统已安装curl,centos可以执行:yum install curl,debian/ubuntu可以执行:apt-get install curl #!/bin/bash # author: neal # website: http://www.baidu.org CheckURL="https://www.baidu.com" S...原创 2019-04-29 10:11:14 · 338 阅读 · 0 评论 -
Nginx配置文件vim下语法高亮显示
1、找到Nginx的二进制安装包,你会发现如下文件夹[root@oradb nginx-1.14.2]# lsauto CHANGES.ru configure html man srcCHANGES conf contrib LICENSE README2、找到contrib/vim文件夹[root@oradb ngi...原创 2019-03-11 22:48:32 · 1358 阅读 · 2 评论 -
【LNMP】提示Nginx PHP “No input file specified”错误的解决办法
原理:任何对.php文件的请求,都简单地交给php-cgi去处理,但没有验证该php文件是否存在,PHP文件不存在,没办法返回普通的404错误,它返回 一个404,并带上一句”No input file specified”,另外,还可能跟 路径或者 权限有关系,或者SCRIPT_FILENAME 变量没有被正确的设置(这在nginx是最常见的原因)。解决办法:1、打开 php.ini...原创 2019-03-08 21:32:30 · 1811 阅读 · 0 评论 -
如何隐藏nginx版本号
出现Nginx版本号的地方有两处:1、HTTP header ,如下图2、Nginx错误页面中 如 404 页面,如果用户没有指定页面的话,那么Nginx自己的页面会有版本标记。1、打开Nginx主配置文件:nginx.conf打开Nginx配置文件 小伙伴根据自己的Nginx配置文件路径修改vim /usr/local/nginx/conf/nginx.conf...原创 2019-03-06 15:48:08 · 5545 阅读 · 0 评论 -
nginx php配置
话不多说了,直接上代码location ~ [^/]\.php(/|$) { #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }fastcgi.conf...原创 2019-10-25 10:18:19 · 337 阅读 · 0 评论 -
thinkphp nginx配置
location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; }}原创 2019-10-25 10:13:46 · 164 阅读 · 0 评论 -
thinkphp、laravel、CI、YII2 Nginx配置
1、thinkphplocation / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; }}2、laravellocation / { try_files $uri $uri/ /index.php?$query_str...原创 2019-10-26 11:02:56 · 384 阅读 · 0 评论 -
php执行curl错误:Could not resolve host: www.baidu.com;Name or service not known
php执行curl错误:Could not resolve host: www.baidu.com; Name or service not known解决办法在获取远程数据的时候,碰到一个很头疼的事情:$url = 'https://www.baidu.com';$curl = curl_init($url);//设置选项curl_setopt_array($curl, arra...原创 2019-10-15 14:33:10 · 5057 阅读 · 2 评论