goaccess export nginx access log to report
使用 goaccess 将 nginx access.log 生成可视化 report.html goaccess github地址 nginx access.log 过滤 # 过滤不统计的日志(如图片、js、css、恶意访问的 login、404 等) cat access.log | grep -vE '(\.css|\.js|\.jpg|\.png|\.gif|\.ico|\.jfif|\.woff|\.woff2|\.eot|\.ttf|\.svg|\.map|bot|Bot|favicon|404|curl|Java|scaninfo|phpMyAdmin|\.env|admin|login|python|http\-client|wp\-|post|POST|\.php|api|ajax|ads\.txt|humans\.txt|well\-known|security\.txt|CONNECT|Head)' > new.log # 只统计 GET 请求 cat new.log | grep 'GET' > new2.log # 只统计 GET 首页的请求 cat new2.log | grep 'GET /' > new3.log goaccess 操作步骤 linux 环境(编译/包管理器)安装 goaccess, 编译安装注意要 --enable-utf8 --enable-geoip=mmdb /etc/goaccess/goaccess.conf 配置 ## 2.1 打开 nginx time-format, date-format, log-format # Apache/NGINX's log formats below. time-format %H:%M:%S # Apache/NGINX's log formats below.Nginx__config Proxy_pass
参考简书: nginx 之 proxy_pass 详解 nginx conf 之 proxy_pass 使用背景 vue3 项目调用后台接口时, 不希望将后端接口地址(host地址) 暴露给普通用户, 并且直接解决浏览器跨域问题, 会使用 nginx 对接口地址作代码, 表面上访问前端 vue 项目的接口地址, 实际上会通过代码转发到真正的后端服务地址 vue3+vite 开发环境在 vite.config.js 配置代理 // vite.config.js export defaut defineConfig({ ... server: { proxy: { '/api': { target: 'http://backend.test/api', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } } } ... }) nginx conf 生产环境 按要代理的地址最后是否带 ‘/’,及是否有 子目录分为 2 种情况, 每种情况按是否有子目录又可再细分为 2 种情况 有 ‘/’ 表示绝对路径, 不带 location; 没有表示相对路径, 要带上 location 后的路径nginx-autoindex-off
nginx autoindex off 禁止目录访问
Recent Posts
Tags
- apache 4
- axios 1
- benchmark 1
- c 1
- canvas 1
- centos 3
- channel 1
- crontab 1
- css 2
- docker 4
- fail2ban 1
- frp 1
- gin 1
- github 1
- go 26
- goaccess 1
- goroutine 1
- http 1
- https 1
- jetbrains 1
- jquery 1
- js 2
- linux 20
- mermaid 1
- mysql 10
- nginx 3
- node 1
- php 43
- prisma 1
- react 8
- server 1
- ssh 2
- tarojs 1
- tcp/ip 1
- token 1
- ubuntu 1
- ufw 1
- unit-test 1
- vmware 1
- vscode 1
- vue 12
- yum 1
- 域名 3
- 安全 2
- 微信 3
- 算法 3