sf1991 最近的时间轴更新
sf1991

sf1991

V2EX 第 244158 号会员,加入于 2017-07-24 14:03:22 +08:00
sf1991 最近回复了
2018-08-09 03:24:46 +08:00
回复了 wxlg1117 创建的主题 问与答 有人配置成功过 nginx 反代 frp 的 https 嘛?
我解决这个问题了:

[NGINX HTTPS and FRPS · Issue #610 · fatedier/frp]( https://github.com/fatedier/frp/issues/610)

[nginx https 转发 frps · Issue #671 · fatedier/frp]( https://github.com/fatedier/frp/issues/671)

你先参考这两个。

我的代理:

```
server {
listen 80;
listen 443 ssl http2;

ssl_certificate /usr/local/nginx/conf/ssl/x.xxx.cn.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/x.xxx.cn.key;

server_name x.xxx.cn;

location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_ssl_server_name on;
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;
#看来这里要写死域名才行啊
proxy_pass https://x.xxx.cn:8080;
}
}
```

我这是为了解决:80 的 http/https 代理到 8080 的 http/https 上去,为了实现隐藏 8080 端口,因为 frp 绑定不论 80 端口,被占用了,所以 frp 只能使用 8080,而我这个代理就是为了隐藏 8080。

tip: 如果只是 http 的代理很容易,但是当我是 https 时,一样的 nginx 代理配置,frp 就不行了,虽然还没有找到真正的问题,但以上 nginx 代理配置也解决了我目前的问题。更多参见:[反向代理 · web 开发最佳实践 · 看云]( https://www.kancloud.cn/xiak/web-dev-best-practice/708208) #https 时的代理
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5459 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 05:51 · PVG 13:51 · LAX 22:51 · JFK 01:51
Developed with CodeLauncher
♥ Do have faith in what you're doing.