[GH-ISSUE #904] 如何使用frp实现http重定向到https #715

Closed
opened 2026-05-05 12:27:33 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @wudinaonao on GitHub (Aug 27, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/904

我的frp版本号是0.21.0
操作系统是Ubuntu

frps 服务端配置如下:
[common]
bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443

authentication_timeout = 0

privilege_token = xxx

dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = xxx
dashboard_pwd = xxx

frpc 客户端配置如下:
[common]
server_addr = x.x.x.x
server_port = 7000

privilege_token = xxxxxx

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[web]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = www.wudinaonao.com
#host_header_rewrite = https://www.wudinaonao.com
[web]
type = https
local_ip =127.0.0.1
local_port = 443
custom_domains = www.wudinaonao.com

我想实现输入www.wudinaonao.com直接跳转到https协议,web服务器我使用apache2,在apache2里已经做了重定向,在内网可以实现输入IP地址直接跳转到https协议,但是如果在外网输入www.wudinaonao.com的话会返回Not found,如果输入https://www.wudinaonao.com 的话可以访问。
初步判断是因为frp设置的问题,但是我通过设置host_header_rewrite发现并没有效果。请问如何可以实现我的想法。感谢!

Originally created by @wudinaonao on GitHub (Aug 27, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/904 我的frp版本号是0.21.0 操作系统是Ubuntu frps 服务端配置如下: [common] bind_port = 7000 vhost_http_port = 80 vhost_https_port = 443 authentication_timeout = 0 privilege_token = xxx dashboard_addr = 0.0.0.0 dashboard_port = 7500 dashboard_user = xxx dashboard_pwd = xxx frpc 客户端配置如下: [common] server_addr = x.x.x.x server_port = 7000 privilege_token = xxxxxx [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 [web] type = http local_ip = 127.0.0.1 local_port = 80 custom_domains = www.wudinaonao.com #host_header_rewrite = https://www.wudinaonao.com [web] type = https local_ip =127.0.0.1 local_port = 443 custom_domains = www.wudinaonao.com 我想实现输入www.wudinaonao.com直接跳转到https协议,web服务器我使用apache2,在apache2里已经做了重定向,在内网可以实现输入IP地址直接跳转到https协议,但是如果在外网输入www.wudinaonao.com的话会返回Not found,如果输入https://www.wudinaonao.com 的话可以访问。 初步判断是因为frp设置的问题,但是我通过设置host_header_rewrite发现并没有效果。请问如何可以实现我的想法。感谢!
Author
Owner

@thorisme commented on GitHub (Aug 28, 2018):

这个我只知道,使用tcp转发各端口的话,可以跳转htts

<!-- gh-comment-id:416463444 --> @thorisme commented on GitHub (Aug 28, 2018): 这个我只知道,使用tcp转发各端口的话,可以跳转htts
Author
Owner

@wudinaonao commented on GitHub (Aug 28, 2018):

您好,我最近刚接触Frp这款软件,有些地方还不是太懂。您说的tcp转发各端口具体指的是什么,方便的话可否告知具体如何操作。我理解的是外网输入域名,然后frps得到请求去连接frpc,然后本地web服务器得到请求并跳转到https协议,fprc返回frps,frps返回给浏览者https网页。
不胜感激!

<!-- gh-comment-id:416489473 --> @wudinaonao commented on GitHub (Aug 28, 2018): 您好,我最近刚接触Frp这款软件,有些地方还不是太懂。您说的tcp转发各端口具体指的是什么,方便的话可否告知具体如何操作。我理解的是外网输入域名,然后frps得到请求去连接frpc,然后本地web服务器得到请求并跳转到https协议,fprc返回frps,frps返回给浏览者https网页。 不胜感激!
Author
Owner

@wudinaonao commented on GitHub (Aug 28, 2018):

问题已经解决!

我发现了问题的解决方案。

Frps配置保持不变,问题出在Frpc的配置上

我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可

例如我修改后的配置如下:

[common]
server_addr = x.x.x.x
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[web01]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = www.wudinaonao.com

[web02]
type = https
local_ip = 127.0.0.1
local_port = 443
custom_domains = www.wudinaonao.com

<!-- gh-comment-id:416503197 --> @wudinaonao commented on GitHub (Aug 28, 2018): 问题已经解决! 我发现了问题的解决方案。 Frps配置保持不变,问题出在Frpc的配置上 我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可 例如我修改后的配置如下: [common] server_addr = x.x.x.x server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 [web01] type = http local_ip = 127.0.0.1 local_port = 80 custom_domains = www.wudinaonao.com [web02] type = https local_ip = 127.0.0.1 local_port = 443 custom_domains = www.wudinaonao.com
Author
Owner

@thorisme commented on GitHub (Aug 28, 2018):

这个没有注意到,我所谓的tcp是使用tcp而非web下的http,不用指定域名,只映射端口就行了。我也是新手,呵呵😄-------- 原始邮件 --------主题:Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)发件人:wudinaonao 收件人:fatedier/frp 抄送:thorisme ,Comment 问题已经解决!
我发现了问题的解决方案。
Frps配置保持不变,问题出在Frpc的配置上
我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可
例如我修改后的配置如下:
[common]
server_addr = 35.194.149.192
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[web01]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = www.wudinaonao.com
[web02]
type = https
local_ip = 127.0.0.1
local_port = 443
custom_domains = www.wudinaonao.com

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/fatedier/frp","title":"fatedier/frp","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/fatedier/frp"}},"updates":{"snippets":[{"icon":"PERSON","message":"@wudinaonao in #904: 问题已经解决!\r\n\r\n我发现了问题的解决方案。\r\n\r\nFrps配置保持不变,问题出在Frpc的配置上\r\n\r\n我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可\r\n\r\n例如我修改后的配置如下:\r\n\r\n[common]\r\nserver_addr = 35.194.149.192\r\nserver_port = 7000\r\n\r\n\r\n[ssh]\r\ntype = tcp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 22\r\nremote_port = 6000\r\n\r\n[web01] \r\ntype = http \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 80 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n[web02] \r\ntype = https \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 443 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/fatedier/frp/issues/904#issuecomment-416503197"}}}
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197",
"url": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)",
"sections": [
{
"text": "",
"activityTitle": "wudinaonao",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@wudinaonao",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueComment",\n"repositoryFullName": "fatedier/frp",\n"issueId": 904,\n"IssueComment": "{{IssueComment.value}}"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueClose",\n"repositoryFullName": "fatedier/frp",\n"issueId": 904\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "MuteNotification",\n"threadId": 372898653\n}"
}
],
"themeColor": "26292E"
}
]

<!-- gh-comment-id:416598495 --> @thorisme commented on GitHub (Aug 28, 2018): 这个没有注意到,我所谓的tcp是使用tcp而非web下的http,不用指定域名,只映射端口就行了。我也是新手,呵呵😄-------- 原始邮件 --------主题:Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)发件人:wudinaonao 收件人:fatedier/frp 抄送:thorisme ,Comment 问题已经解决! 我发现了问题的解决方案。 Frps配置保持不变,问题出在Frpc的配置上 我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可 例如我修改后的配置如下: [common] server_addr = 35.194.149.192 server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 [web01] type = http local_ip = 127.0.0.1 local_port = 80 custom_domains = www.wudinaonao.com [web02] type = https local_ip = 127.0.0.1 local_port = 443 custom_domains = www.wudinaonao.com —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/fatedier/frp","title":"fatedier/frp","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/fatedier/frp"}},"updates":{"snippets":[{"icon":"PERSON","message":"@wudinaonao in #904: 问题已经解决!\r\n\r\n我发现了问题的解决方案。\r\n\r\nFrps配置保持不变,问题出在Frpc的配置上\r\n\r\n我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可\r\n\r\n例如我修改后的配置如下:\r\n\r\n[common]\r\nserver_addr = 35.194.149.192\r\nserver_port = 7000\r\n\r\n\r\n[ssh]\r\ntype = tcp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 22\r\nremote_port = 6000\r\n\r\n[web01] \r\ntype = http \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 80 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n[web02] \r\ntype = https \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 443 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/fatedier/frp/issues/904#issuecomment-416503197"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197", "url": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)", "sections": [ { "text": "", "activityTitle": "**wudinaonao**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@wudinaonao", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"fatedier/frp\",\n\"issueId\": 904,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"fatedier/frp\",\n\"issueId\": 904\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 372898653\n}" } ], "themeColor": "26292E" } ]
Author
Owner

@wudinaonao commented on GitHub (Aug 28, 2018):

感谢您的帮助!

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用


发件人: thorisme notifications@github.com
发送时间: Tuesday, August 28, 2018 10:11:36 PM
收件人: fatedier/frp
抄送: wudinaonao; Mention
主题: Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)

这个没有注意到,我所谓的tcp是使用tcp而非web下的http,不用指定域名,只映射端口就行了。我也是新手,呵呵😄-------- 原始邮件 --------主题:Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)发件人:wudinaonao 收件人:fatedier/frp 抄送:thorisme ,Comment 问题已经解决!
我发现了问题的解决方案。
Frps配置保持不变,问题出在Frpc的配置上
我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可
例如我修改后的配置如下:
[common]
server_addr = 35.194.149.192
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[web01]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = www.wudinaonao.com
[web02]
type = https
local_ip = 127.0.0.1
local_port = 443
custom_domains = www.wudinaonao.com

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/fatedier/frp","title":"fatedier/frp","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/fatedier/frp"}},"updates":{"snippets":[{"icon":"PERSON","message":"@wudinaonao in #904: 问题已经解决!\r\n\r\n我发现了问题的解决方案。\r\n\r\nFrps配置保持不变,问题出在Frpc的配置上\r\n\r\n我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可\r\n\r\n例如我修改后的配置如下:\r\n\r\n[common]\r\nserver_addr = 35.194.149.192\r\nserver_port = 7000\r\n\r\n\r\n[ssh]\r\ntype = tcp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 22\r\nremote_port = 6000\r\n\r\n[web01] \r\ntype = http \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 80 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n[web02] \r\ntype = https \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 443 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/fatedier/frp/issues/904#issuecomment-416503197"}}}
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197",
"url": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)",
"sections": [
{
"text": "",
"activityTitle": "wudinaonao",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@wudinaonao",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueComment",\n"repositoryFullName": "fatedier/frp",\n"issueId": 904,\n"IssueComment": "{{IssueComment.value}}"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueClose",\n"repositoryFullName": "fatedier/frp",\n"issueId": 904\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "MuteNotification",\n"threadId": 372898653\n}"
}
],
"themeColor": "26292E"
}
]


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/fatedier/frp/issues/904#issuecomment-416598495, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfHHvHT8tqJTuiTF_yqhpU2Z1D_K7vBhks5uVU-YgaJpZM4WOftd.

<!-- gh-comment-id:416600832 --> @wudinaonao commented on GitHub (Aug 28, 2018): 感谢您的帮助! 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 ________________________________ 发件人: thorisme <notifications@github.com> 发送时间: Tuesday, August 28, 2018 10:11:36 PM 收件人: fatedier/frp 抄送: wudinaonao; Mention 主题: Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904) 这个没有注意到,我所谓的tcp是使用tcp而非web下的http,不用指定域名,只映射端口就行了。我也是新手,呵呵😄-------- 原始邮件 --------主题:Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)发件人:wudinaonao 收件人:fatedier/frp 抄送:thorisme ,Comment 问题已经解决! 我发现了问题的解决方案。 Frps配置保持不变,问题出在Frpc的配置上 我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可 例如我修改后的配置如下: [common] server_addr = 35.194.149.192 server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 [web01] type = http local_ip = 127.0.0.1 local_port = 80 custom_domains = www.wudinaonao.com [web02] type = https local_ip = 127.0.0.1 local_port = 443 custom_domains = www.wudinaonao.com —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/fatedier/frp","title":"fatedier/frp","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/fatedier/frp"}},"updates":{"snippets":[{"icon":"PERSON","message":"@wudinaonao in #904: 问题已经解决!\r\n\r\n我发现了问题的解决方案。\r\n\r\nFrps配置保持不变,问题出在Frpc的配置上\r\n\r\n我发现Http和https的名称同为[web] 是问题的原因,只要把http和https的名称改成不同的名字即可\r\n\r\n例如我修改后的配置如下:\r\n\r\n[common]\r\nserver_addr = 35.194.149.192\r\nserver_port = 7000\r\n\r\n\r\n[ssh]\r\ntype = tcp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 22\r\nremote_port = 6000\r\n\r\n[web01] \r\ntype = http \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 80 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n[web02] \r\ntype = https \r\nlocal_ip = 127.0.0.1 \r\nlocal_port = 443 \r\ncustom_domains = www.wudinaonao.com \r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/fatedier/frp/issues/904#issuecomment-416503197"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197", "url": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [fatedier/frp] 如何使用frp实现http重定向到https (#904)", "sections": [ { "text": "", "activityTitle": "**wudinaonao**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@wudinaonao", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"fatedier/frp\",\n\"issueId\": 904,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"fatedier/frp\",\n\"issueId\": 904\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/fatedier/frp/issues/904#issuecomment-416503197" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 372898653\n}" } ], "themeColor": "26292E" } ] — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/fatedier/frp/issues/904#issuecomment-416598495>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AfHHvHT8tqJTuiTF_yqhpU2Z1D_K7vBhks5uVU-YgaJpZM4WOftd>.
Author
Owner

@cloverzrg commented on GitHub (Aug 31, 2018):

nginx config for frps
(frps running in docker https://hub.docker.com/r/cloverzrg/frps-docker/)

frps.mydomain.com.conf

server {
	listen	  80;
	server_name    frp.mydomain.com;
	return	  302 https://$server_name$request_uri;
}

upstream frp-dashboard {
    server 127.0.0.1:7500;
}

upstream frp-http {
    server 127.0.0.1:60005;
}

server {

    listen 443 ssl http2;
    server_name frp.mydomain.com;
    ssl_certificate /root/.acme.sh/mydomain.com/fullchain.cer;
    ssl_certificate_key /root/.acme.sh/mydomain.com/mydomain.com.key;

    gzip_proxied no-cache no-store private expired auth;
    gzip_min_length 1000;

  location / {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass http://frp-dashboard/;

      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-Port $server_port;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

}

server {
        listen    80;
        server_name    *.frp.mydomain.com;
        return    302 https://$host$request_uri;
}

server {

    listen 443 ssl http2;
    server_name *.frp.mydomain.com;
    ssl_certificate /root/.acme.sh/mydomain.com/fullchain.cer;
    ssl_certificate_key /root/.acme.sh/mydomain.com/mydomain.com.key;

    gzip_proxied no-cache no-store private expired auth;
    gzip_min_length 1000;

  location / {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass http://frp-http/;

      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-Port $server_port;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

}
<!-- gh-comment-id:417535548 --> @cloverzrg commented on GitHub (Aug 31, 2018): nginx config for frps (frps running in docker https://hub.docker.com/r/cloverzrg/frps-docker/) frps.mydomain.com.conf ``` server { listen 80; server_name frp.mydomain.com; return 302 https://$server_name$request_uri; } upstream frp-dashboard { server 127.0.0.1:7500; } upstream frp-http { server 127.0.0.1:60005; } server { listen 443 ssl http2; server_name frp.mydomain.com; ssl_certificate /root/.acme.sh/mydomain.com/fullchain.cer; ssl_certificate_key /root/.acme.sh/mydomain.com/mydomain.com.key; gzip_proxied no-cache no-store private expired auth; gzip_min_length 1000; location / { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_pass http://frp-dashboard/; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; server_name *.frp.mydomain.com; return 302 https://$host$request_uri; } server { listen 443 ssl http2; server_name *.frp.mydomain.com; ssl_certificate /root/.acme.sh/mydomain.com/fullchain.cer; ssl_certificate_key /root/.acme.sh/mydomain.com/mydomain.com.key; gzip_proxied no-cache no-store private expired auth; gzip_min_length 1000; location / { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_pass http://frp-http/; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ```
Author
Owner

@SenLief commented on GitHub (Sep 22, 2018):

ydomain.com.conf

您好,我能问下您上面那个proxy_pass http://frp-http/这个frp-http是修改成什么呢

<!-- gh-comment-id:423727309 --> @SenLief commented on GitHub (Sep 22, 2018): > ydomain.com.conf 您好,我能问下您上面那个proxy_pass http://frp-http/这个frp-http是修改成什么呢?
Author
Owner

@cloverzrg commented on GitHub (Sep 22, 2018):

ydomain.com.conf

您好,我能问下您上面那个proxy_pass http://frp-http/这个frp-http是修改成什么呢?

比如 127.0.0.1:8080

<!-- gh-comment-id:423752019 --> @cloverzrg commented on GitHub (Sep 22, 2018): > > ydomain.com.conf > > 您好,我能问下您上面那个proxy_pass [http://frp-http/这个frp-http是修改成什么呢?](http://frp-http/%E8%BF%99%E4%B8%AAfrp-http%E6%98%AF%E4%BF%AE%E6%94%B9%E6%88%90%E4%BB%80%E4%B9%88%E5%91%A2%EF%BC%9F) 比如 `127.0.0.1:8080`
Author
Owner

@SenLief commented on GitHub (Sep 22, 2018):

多谢,找到了😁
2018年9月22日 +0800 PM11:32 朱润根 notifications@github.com,写道:

ydomain.com.conf
您好,我能问下您上面那个proxy_pass http://frp-http/这个frp-http是修改成什么呢
比如 127.0.0.1:8080

You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:423752553 --> @SenLief commented on GitHub (Sep 22, 2018): 多谢,找到了😁 2018年9月22日 +0800 PM11:32 朱润根 <notifications@github.com>,写道: > > > ydomain.com.conf > > 您好,我能问下您上面那个proxy_pass http://frp-http/这个frp-http是修改成什么呢? > 比如 127.0.0.1:8080 > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@geekyouth commented on GitHub (Oct 12, 2018):

client 端所有的80请求通过 nginx 转发到 443 ssl,frp 只需要关心内网穿透即可

<!-- gh-comment-id:429258038 --> @geekyouth commented on GitHub (Oct 12, 2018): client 端所有的80请求通过 nginx 转发到 443 ssl,frp 只需要关心内网穿透即可
Author
Owner

@cloverzrg commented on GitHub (Oct 12, 2018):

这issue怎么还不关

<!-- gh-comment-id:429279963 --> @cloverzrg commented on GitHub (Oct 12, 2018): 这issue怎么还不关
Author
Owner

@cisordeng commented on GitHub (Mar 18, 2020):

感谢,重新检查了一下配置文件,我的也是有一点小问题。已经解决了

<!-- gh-comment-id:600413042 --> @cisordeng commented on GitHub (Mar 18, 2020): 感谢,重新检查了一下配置文件,我的也是有一点小问题。已经解决了
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#715
No description provided.