nginx 服务器如何查看当前访问的域名
Song •
30 次浏览 •
0个评论 •
2025年06月10日
当我们网站被攻击时希望查看攻击从哪个域名而来,方便做其他处理;但是默认的日志不展示,所以我们需要自己开启一下。
vim /etc/nginx/nginx.conf
然后在http中添加
log_format custom '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$server_name"';
然后设置日志格式为定义的custom:
access_log /var/log/nginx/access.log custom;
更多相关好文
-
laravel中distinct()的使用方法与去重 2017-09-11
-
Laravel将view缓存为静态html,laravel页面静态缓存 2021-10-09
-
[ laravel爬虫实战--基础篇 ] guzzle描述与安装 2017-11-01
-
[ 配置教程 ] 在ubuntu16.04中部署LNMP环境(php7+maridb且开启maridb远程以及nginx多域名访问 )并配置laravel环境 2017-07-18
-
nginx 服务器如何查看当前访问的域名 2025-06-10
热门文章
-
nginx 服务器如何查看当前访问的域名 2025-06-10
-
ubuntu+nginx当服务器异常时微信/企业微信/抖音数据重复回调导致服务器崩溃怎么解决? 2025-05-30
-
Jquery使用xlsx实现批量导入Excel数据 2025-05-12
-
laravel11如何启用routes/api.php无状态路由 2025-03-06
-
oppo手机默认浏览器urlscheme 2025-02-13
ubuntu+nginx当服务器异常时微信/企业微信/抖音数据重复回调导致服务器崩溃怎么解决?