Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51fb056

Browse files
committed
host
1 parentaf66ca8 commit51fb056

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎fastcaddy/core.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def add_wildcard_route(domain):
177177
add_route(route)
178178

179179
# %% ../nbs/00_core.ipynb 48
180-
defadd_sub_reverse_proxy(domain,subdomain,port):
180+
defadd_sub_reverse_proxy(domain,subdomain,port,host='localhost'):
181181
"Add a reverse proxy to a wildcard subdomain"
182182
wildcard_id=f"wildcard-{domain}"
183183
route_id=f"{subdomain}.{domain}"
@@ -186,7 +186,7 @@ def add_sub_reverse_proxy(domain, subdomain, port):
186186
"match": [{"host": [route_id]}],
187187
"handle": [{
188188
"handler":"reverse_proxy",
189-
"upstreams": [{"dial":f"localhost:{port}"}]
189+
"upstreams": [{"dial":f"{host}:{port}"}]
190190
}]
191191
}
192192
pid([new_route],f"{wildcard_id}/handle/0/routes/...")

‎nbs/00_core.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
"outputs": [],
610610
"source": [
611611
"#| export\n",
612-
"def add_sub_reverse_proxy(domain, subdomain, port):\n",
612+
"def add_sub_reverse_proxy(domain, subdomain, port, host='localhost'):\n",
613613
"\"Add a reverse proxy to a wildcard subdomain\"\n",
614614
" wildcard_id = f\"wildcard-{domain}\"\n",
615615
" route_id = f\"{subdomain}.{domain}\"\n",
@@ -618,7 +618,7 @@
618618
"\"match\": [{\"host\": [route_id]}],\n",
619619
"\"handle\": [{\n",
620620
"\"handler\":\"reverse_proxy\",\n",
621-
"\"upstreams\": [{\"dial\": f\"localhost:{port}\"}]\n",
621+
"\"upstreams\": [{\"dial\": f\"{host}:{port}\"}]\n",
622622
" }]\n",
623623
" }\n",
624624
" pid([new_route], f\"{wildcard_id}/handle/0/routes/...\")"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp