惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
Recorded Future
Recorded Future
T
Tenable Blog
S
Securelist
C
CERT Recently Published Vulnerability Notes
T
Threatpost
S
Schneier on Security
A
Arctic Wolf
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
K
Kaspersky official blog
T
True Tiger Recordings
T
Threat Research - Cisco Blogs
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Spread Privacy
Spread Privacy
Malwarebytes
Malwarebytes
P
Proofpoint News Feed
F
Fox-IT International blog
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
量子位
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Project Zero
Project Zero
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
I
Intezer
博客园_首页
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security

NGINX

fail2ban 保护 nginx 方案 麦当劳服务模式是 nginx,肯德基服务模式是 apache,这样理解对不对? oracleusa.ml 的实现原理 尝试自己配置转发后端请求的时候有个疑问 请教 Nginx 时完整的 SSL 刷新教程或者脚本 问问大家 nginx 日志流量分析用什么方案? nginx 二级目录反向代理是不是有先天缺陷? nginx rewrite 指令的问题 请问下为啥微信客户端访问到 nginx 没有参数了? 有兄弟们用 nginx proxy manager(或者其他图形化工具)来管理 nginx 反向代理的吗? 请问 Nginx 怎么添加 CORS 白名单? 使用 nginx 监听已被监听的端口, reload 不会失败, 但会导致其他配置不生效. nginx 如何获取/打印完整代理路径? Nginx 四层反代 QUIC 如何传递客户端 IP 关于 windows 下面重启之后 nginx 的问题 我是不是可以反向代理个 V2EX 网站? 用 nginx 做的 xai 的转发好像一直有问题 请教一个 Nginx 配置和浏览器强制 http 转 https 问题 nginx proxy manager ipv6 反代指向内网 ipv4 局域网地址,还可以这样操作🤔? 关于 Nginx 反向代理性能调优的问题,求指导🙏 nginx 配置根据请求头分发问题 用过 nginx-proxy-manager 请进, 咨询个问题. 我有一个端口转发问题,求大佬们协助 使用 Nginx 代理 Emby 服务器,浏览器可以访问但是客户端连不上 小白在使用 Nginx proxy manager 遇到问题,请大佬们指教。 请教下 nginx 反代配置 nginx 配置问题求解答 Nginx 流量异常,请大佬支招~ nginx 读取 ssl 证书的权限问题请教 请问一个二级域名如何配置可以访问多个 http 服务? 配置证书相关的问题 关于 nginx 的一些提问 nginx 限流失败的奇怪问题 反向代理提示该网站已被拦截,请教 为什么我的 docker nginx 的不能反向代理 favicon 啊 Nginx 能不能实现按域名限制网速? 请教一下各位关于 nginx 版本更新区别导致反向代理无法访问的问题 虚心请教一个有关于 nginx 配置的问题 求解 nginx 反代某堡垒机 443 页面出现问题 nginx if 语句 return 403,没办法跳转自定义 403 页面 请教 nginx deny 优先级的问题。 求教关于反代的问题 nginx 增加 http 块 就报证书错误,请问是什么原因,第一次见 有台生产服务器, Nginx 每天都会因为不同原因 exit 一次,虽然配了自动重启,有没办法排查是什么原因?平均一天 1820 万请求 openresty 怎么修改代理站的文件返回给客户端 有啥平替 resend、ZeptoMail 的国内解决方案嘛? 求救:屏蔽爬虫试了 2 天,没成功
问个 nginx 配置问题
kyonn · 2025-08-01 · via NGINX

抄来的 nginx 配置,第 1 个 location 的正则表达式不太确定是否正确。按照 AI 的解答,用于匹配下面这几种路径。实测下来,http git clone 也是失败的,未匹配第 1 个 location 。有几个疑点:

  1. 类似这种多行的正则,每一行之间是什么关系?按照 AI 的解答看上去是或的关系,但是没找到正则规则的依据。
  2. 每一行正则结尾是 空格 + 单引号,这个不知道又是什么规则?
  • /git/xxx/HEAD (获取仓库的 HEAD 文件)
  • /git/xxx/info/refs (获取仓库引用信息)
  • /git/xxx/objects/...(处理 Git 对象)
  • /git/xxx/git-upload-pack

location ~ "(?x)^/git(?<path>/.*/(?:HEAD '
                             info/refs '
                             objects/(?:info/[^/]+ '
                                        [0-9a-f]{2}/[0-9a-f]{38} '
                                        pack/pack-[0-9a-f]{40}\.(?:pack '
                                                                   idx)) '
                             git-upload-pack))$" {
        error_page 491 = @auth;
        if ($query_string = service=git-receive-pack) {
                return 491;
        }
        client_max_body_size                    0;

        fastcgi_param   SCRIPT_FILENAME         /usr/lib/git-core/git-http-backend;
        include         fastcgi_params;
        fastcgi_param   GIT_HTTP_EXPORT_ALL     "";
        fastcgi_param   GIT_PROJECT_ROOT        /srv/git;
        fastcgi_param   PATH_INFO               $path;

        fastcgi_param   REMOTE_USER             $remote_user;
        fastcgi_pass    unix:/var/run/fcgiwrap.socket;
}
location ~ "^/git(?<path>/.*/git-receive-pack)$" {
        error_page 491 = @auth;
        return 491;
}
location @auth {
        auth_basic            "Git write access";
        auth_basic_user_file  /srv/git/.htpasswd;

        client_max_body_size                    0;

        fastcgi_param   SCRIPT_FILENAME         /usr/lib/git-core/git-http-backend;
        include         fastcgi_params;
        fastcgi_param   GIT_HTTP_EXPORT_ALL     "";
        fastcgi_param   GIT_PROJECT_ROOT        /srv/git;
        fastcgi_param   PATH_INFO               $path;

        fastcgi_param   REMOTE_USER             $remote_user;
        fastcgi_pass    unix:/var/run/fcgiwrap.socket;
}
location ~ ^/git(?<path>/.*)$ {
        alias /usr/share/cgit;
        try_files $1 @cgit;
}
location @cgit {
        include         fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
        fastcgi_param   PATH_INFO       $path;
        fastcgi_param   QUERY_STRING    $args;
        fastcgi_param   HTTP_HOST       $server_name;

        fastcgi_param   CGIT_CONFIG     /srv/git/.cgitrc;

        fastcgi_pass    unix:/var/run/fcgiwrap.socket;
}