mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update site_api.py
This commit is contained in:
@@ -1537,7 +1537,8 @@ class site_api:
|
||||
rep = "http(s)?\:\/\/([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\.)+([a-zA-Z0-9][a-zA-Z0-9]{0,62})+.?"
|
||||
if not re.match(rep, _to):
|
||||
return mw.returnJson(False, "错误的目标地址!")
|
||||
_to = _to.strip("/")
|
||||
|
||||
# _to = _to.strip("/")
|
||||
# get host from url
|
||||
try:
|
||||
if _host == "$host":
|
||||
@@ -1546,9 +1547,10 @@ class site_api:
|
||||
except:
|
||||
return mw.returnJson(False, "错误的目标地址")
|
||||
|
||||
# location ~* ^{from}(.*)$ {
|
||||
tpl = """
|
||||
# PROXY-START/
|
||||
location ~* ^{from}(.*)$ {
|
||||
location ^~ {from} {
|
||||
proxy_pass {to};
|
||||
proxy_set_header Host {host};
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in New Issue
Block a user