Skip to content
Discussion options

You must be logged in to vote

首先 Caddy SNI 没有重定向功能,实现你需要的重定向配置如下:
80 端口部分修改

//........<省略>........
					"routes": [
						{
							"handle": [
								{
									"handler": "static_response",
									"headers": {
										"Location": [
											"https://{http.request.host}{http.request.uri}"
										]
									},
									"status_code": 301
								}
							]
						}
					],
					"protocols": ["h1"]
//........<省略>........

5443 端口部分修改

//........<省略>........
						{
							"match": [
								{
									"host": [
										"example.com"
									]
								}
							],
							"handle": [
								{
									"handler": "static_response",
									"headers": {
										"Location": [
											"https://www.example.com…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lxhao61
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #172 on August 30, 2023 14:24.