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

推荐订阅源

D
Docker
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
博客园 - 聂微东
S
SegmentFault 最新的问题
量子位
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页

NGINX

有用 Nginx UI 的朋友吗?这玩意是不是时不时将磁盘 IO 打满? fail2ban 保护 nginx 方案 麦当劳服务模式是 nginx,肯德基服务模式是 apache,这样理解对不对? oracleusa.ml 的实现原理 尝试自己配置转发后端请求的时候有个疑问 请教 Nginx 时完整的 SSL 刷新教程或者脚本 问问大家 nginx 日志流量分析用什么方案? nginx 二级目录反向代理是不是有先天缺陷? nginx rewrite 指令的问题 问个 nginx 配置问题 请问下为啥微信客户端访问到 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 流量异常,请大佬支招~
求教关于反代的问题
Aicnal · 2024-08-24 · via NGINX

之前部署了一个 Discourse 站点 部署在一台配置比较高但是线路没有优化的机器上 容器内部使用 nginx 然后通过 Unix Socket 使用宿主机的 Caddy 进行域名访问 之后我在线路比较好的香港服务器上部署 Nginx 对原站进行反代 但是反代后为502,无法正常访问 我看了下error.log说的是代理服务器和源站 ssl 握手失败 但是我在代理服务器里面写的是https,而且代理服务器curl能正常获取到内容 这个是源站的caddyfile

direct.example.com {
    reverse_proxy unix//var/discourse/shared/standalone/nginx.http.sock {
        header_up Host {host}
        header_up X-Real-IP {remote}
        header_up X-Forwarded-For {remote}
        header_up X-Forwarded-Proto {scheme}
    }
 header {
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    }
}

synapse.know-cnu.wiki {
    reverse_proxy localhost:8008 {
        # WebSocket 连接的默认配置
        header_up Host {host}
        header_up X-Real-IP {remote}
        header_up X-Forwarded-For {remote}
        header_up X-Forwarded-Proto {scheme}

        # 处理 WebSocket 连接
        transport http {
            read_buffer 0
        }
    }

    # 设置 HSTS 头部
    header {
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    }

这个是代理服务器的nginx.conf,未使用ssl

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass https://direct.example.com;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

error.log如下

root@VM80459:~# tail -f /var/log/nginx/error.log
2024/08/24 06:08:57 [emerg] 3325#3325: "server" directive is not allowed here in /etc/nginx/nginx.conf:11
2024/08/24 06:09:05 [emerg] 3326#3326: "server" directive is not allowed here in /etc/nginx/nginx.conf:11
2024/08/24 06:10:18 [notice] 3373#3373: signal process started
2024/08/24 06:19:53 [notice] 3445#3445: signal process started
2024/08/24 06:20:02 [error] 3446#3446: *12 SSL_do_handshake() failed (SSL: error:0A000438:SSL routines::tlsv1 alert internal error:SSL alert number 80) while SSL handshaking to upstream, client: 1xx.1x.5x.xx, server: know-cnu.wiki, request: "GET / HTTP/1.1", upstream: "https://[2400:61xx:0:dx::xa:a0x]:443/", host: "example.com"
2024/08/24 06:20:02 [error] 3446#3446: *12 SSL_do_handshake() failed (SSL: error:0A000438:SSL routines::tlsv1 alert internal error:SSL alert number 80) while SSL handshaking to upstream, client: 10x.13x.5x.18x, server: example.com, request: "GET / HTTP/1.1", upstream: "https://15x.8x.2xx.xx:443/", host: "example.com"