mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #610] NGINX HTTPS and FRPS #474
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#474
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @keyoti on GitHub (Jan 18, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/610
I see two issues #359 and #565 that relate to trying to use NGINX and FRP with SSL. @JaynLau @WordlessEcho @zc57520
It is not working because of this line in nginx config.
proxy_pass https://127.0.0.1:7443;because (for SSL) FRPS cannot get the hostname (ie subdomain) even with
proxy_set_header Host $host;The solution is to use the domain name, so that FRPS can identify the correct host.
proxy_pass https://test.example.com:7443;You will also need to add a resolver in nginx, eg
resolver 8.8.8.8;@fatedier commented on GitHub (Jan 19, 2018):
Yes, you give the meaningful answer.
Another way to solve this problem is
proxy_ssl_server_name.@liucodeing commented on GitHub (Feb 27, 2018):
location / {
proxy_pass https://domain.com:7443;
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;
}
nginx如果使用这种配置是可以正常使用的,
问题解决了, 我还有一个疑问🤔️
我用apache同样提供了一个 https://127.0.0.1:9443 的web服务, nginx配置使用
location / {
proxy_pass https://127.0.0.1:9443;
proxy_set_header Host $http_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;
}
完全没有问题,可以正常访问.
frps也是提供了一个https的web服务, 使用相同的nginx配置为什么就不能正常访问呢?
这是否说明 frps的https是存在问题的!
@fatedier commented on GitHub (Feb 27, 2018):
@312102021 建议自行研究下相关的知识。
@liucodeing commented on GitHub (Feb 27, 2018):
谢谢!
@wkingfly commented on GitHub (Nov 30, 2018):
其实很大的原因是 ssl 个人证书的问题。有一个相对来说比较简单且可以省掉你大量时间和精力是目前最优雅的解决方案:
去 get 一个 Google 的 .app 域名。为什么呢,因为它强制 https 安全机制,结合 Cloudflare 使用的话证书这些全都不用你去 care,你只需要配置 http 服务即可。
有了 .app 域名,frps 配置 vhost_http_port = 8080,client 端全部按 http 服务来配置,nginx 如下配置即可:
@hbfrank commented on GitHub (Apr 12, 2019):
这样的话,从frps到client的http就是在裸奔了,前端的https不就失去了意义?
@wkingfly commented on GitHub (Apr 13, 2019):
多谢提醒,有个参数 use_encryption = false 可保证 frps 到 frpc 之间的通讯是加密的,不过你说的问题是有安全隐患的,目前的更好的解决方案如下:
当前的 README 有一段:
现在最新版本已经是 0.26.0 , 因此请尽快升级到最新版本并如此设置。另外,仍需要按照我上面的提议来对访问端和 frps 的过程进行加密。
@hbfrank commented on GitHub (Sep 9, 2019):
感谢!