diff --git a/caddy-gen/src/caddy-gen.py b/caddy-gen/src/caddy-gen.py index 5e913af0..f9b31609 100644 --- a/caddy-gen/src/caddy-gen.py +++ b/caddy-gen/src/caddy-gen.py @@ -82,12 +82,24 @@ def repo_no_redir(base: str, repo: Repo, site: str) -> list[Node]: ] +def repo_redir_scheme_keep(base: str, repo: Repo, site: str) -> list[Node]: + strip_prefix = Node(f'uri strip_prefix /{repo.get_name()}') + redir_node = Node(f'redir * {repo.target}{{uri}} 302') + return [ + Node(f'http://{base}/{repo.get_name()}', log() + repo_redir(repo)), + Node(f'http://{base}/{repo.get_name()}/*', log() + + [Node(f'route *', [strip_prefix, redir_node])]) + ] + + def dict_to_repo(repo: dict) -> Repo: serve_mode = repo.get('serve_mode', 'default') if serve_mode == 'redir': - return RedirRepo(repo['name'], repo['target'], False) + return RedirRepo(repo['name'], repo['target'], False, False) if serve_mode == 'redir_force': - return RedirRepo(repo['name'], repo['target'], True) + return RedirRepo(repo['name'], repo['target'], True, False) + if serve_mode == 'redir_scheme_keep': + return RedirRepo(repo['name'], repo['target'], False, True) if serve_mode == 'default': path = repo['path'] name = repo['name'] @@ -136,6 +148,8 @@ def gen_repos(base: str, repos: dict, first_site: bool, site: str) -> tuple[list git_server_nodes += repo.as_repo() else: file_server_nodes += repo.as_repo() + if isinstance(repo, RedirRepo) and repo.scheme_keep: + outer_nodes += repo_redir_scheme_keep(base, repo, site) if 'subdomain' in repo_ and first_site: outer_nodes += [Node(repo_['subdomain'], @@ -210,7 +224,14 @@ def rewrite_config(repo: dict, site: str): 'serve_mode': 'proxy', 'strip_prefix': False } - if serve_mode == 'default' or serve_mode == 'git': + if serve_mode == 'default': + name = repo['name'] + return { + 'name': name, + 'serve_mode': 'redir_scheme_keep', + 'target': f'{{scheme}}://{BASES[site][0]}/{name}' + } + if serve_mode == 'git': name = repo['name'] return { 'name': name, diff --git a/caddy-gen/src/repos.py b/caddy-gen/src/repos.py index ff18f743..437f7445 100644 --- a/caddy-gen/src/repos.py +++ b/caddy-gen/src/repos.py @@ -101,6 +101,7 @@ class RedirRepo: name: str = '' target: str = '' always_target: bool = False + scheme_keep: bool = False def as_repo(self) -> list[Node]: redir_always_node = Node(f'redir * {self.target} 302') diff --git a/caddy/Caddyfile.siyuan b/caddy/Caddyfile.siyuan index 51c504e2..4cca798f 100644 --- a/caddy/Caddyfile.siyuan +++ b/caddy/Caddyfile.siyuan @@ -335,6 +335,652 @@ http://mirror.sjtu.edu.cn/fedora/* { header * x-sjtug-mirror-id siyuan } +http://mirror.sjtu.edu.cn/putty { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /putty /putty/ 301 +} + +http://mirror.sjtu.edu.cn/putty/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /putty + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/putty{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/archlinux-cn { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /archlinux-cn /archlinux-cn/ 301 +} + +http://mirror.sjtu.edu.cn/archlinux-cn/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /archlinux-cn + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/archlinux-cn{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/archlinuxarm { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /archlinuxarm /archlinuxarm/ 301 +} + +http://mirror.sjtu.edu.cn/archlinuxarm/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /archlinuxarm + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/archlinuxarm{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/gentoo { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /gentoo /gentoo/ 301 +} + +http://mirror.sjtu.edu.cn/gentoo/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /gentoo + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/gentoo{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/vim { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /vim /vim/ 301 +} + +http://mirror.sjtu.edu.cn/vim/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /vim + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/vim{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/alpine { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /alpine /alpine/ 301 +} + +http://mirror.sjtu.edu.cn/alpine/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /alpine + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/alpine{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/cpan { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /cpan /cpan/ 301 +} + +http://mirror.sjtu.edu.cn/cpan/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /cpan + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cpan{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/cran { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /cran /cran/ 301 +} + +http://mirror.sjtu.edu.cn/cran/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /cran + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cran{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/ctex { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ctex /ctex/ 301 +} + +http://mirror.sjtu.edu.cn/ctex/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ctex + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ctex{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/gnu { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /gnu /gnu/ 301 +} + +http://mirror.sjtu.edu.cn/gnu/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /gnu + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/gnu{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/cygwin { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /cygwin /cygwin/ 301 +} + +http://mirror.sjtu.edu.cn/cygwin/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /cygwin + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cygwin{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/ros { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ros /ros/ 301 +} + +http://mirror.sjtu.edu.cn/ros/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ros + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ros{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/kali { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /kali /kali/ 301 +} + +http://mirror.sjtu.edu.cn/kali/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /kali + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/kali{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/kali-images { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /kali-images /kali-images/ 301 +} + +http://mirror.sjtu.edu.cn/kali-images/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /kali-images + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/kali-images{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/raspbian { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /raspbian /raspbian/ 301 +} + +http://mirror.sjtu.edu.cn/raspbian/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /raspbian + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspbian{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/parrot { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /parrot /parrot/ 301 +} + +http://mirror.sjtu.edu.cn/parrot/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /parrot + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/parrot{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/raspberrypi { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /raspberrypi /raspberrypi/ 301 +} + +http://mirror.sjtu.edu.cn/raspberrypi/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /raspberrypi + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspberrypi{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/mx-isos { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /mx-isos /mx-isos/ 301 +} + +http://mirror.sjtu.edu.cn/mx-isos/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /mx-isos + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mx-isos{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/mx-packages { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /mx-packages /mx-packages/ 301 +} + +http://mirror.sjtu.edu.cn/mx-packages/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /mx-packages + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mx-packages{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/packagist { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /packagist /packagist/ 301 +} + +http://mirror.sjtu.edu.cn/packagist/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /packagist + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/packagist{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/mongodb { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /mongodb /mongodb/ 301 +} + +http://mirror.sjtu.edu.cn/mongodb/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /mongodb + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mongodb{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/qt { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /qt /qt/ 301 +} + +http://mirror.sjtu.edu.cn/qt/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /qt + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/qt{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/julia { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /julia /julia/ 301 +} + +http://mirror.sjtu.edu.cn/julia/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /julia + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/julia{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/emacs-elpa { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /emacs-elpa /emacs-elpa/ 301 +} + +http://mirror.sjtu.edu.cn/emacs-elpa/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /emacs-elpa + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/emacs-elpa{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/julia-releases { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /julia-releases /julia-releases/ 301 +} + +http://mirror.sjtu.edu.cn/julia-releases/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /julia-releases + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/julia-releases{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/raspberry-pi-os-images { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /raspberry-pi-os-images /raspberry-pi-os-images/ 301 +} + +http://mirror.sjtu.edu.cn/raspberry-pi-os-images/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /raspberry-pi-os-images + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspberry-pi-os-images{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/msys2 { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /msys2 /msys2/ 301 +} + +http://mirror.sjtu.edu.cn/msys2/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /msys2 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/msys2{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/linuxliteos { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /linuxliteos /linuxliteos/ 301 +} + +http://mirror.sjtu.edu.cn/linuxliteos/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /linuxliteos + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/linuxliteos{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/download.flutter.io { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /download.flutter.io /download.flutter.io/ 301 +} + +http://mirror.sjtu.edu.cn/download.flutter.io/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /download.flutter.io + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/download.flutter.io{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/CPAN { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /CPAN /CPAN/ 301 +} + +http://mirror.sjtu.edu.cn/CPAN/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /CPAN + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CPAN{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/CRAN { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /CRAN /CRAN/ 301 +} + +http://mirror.sjtu.edu.cn/CRAN/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /CRAN + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CRAN{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/CTAN { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /CTAN /CTAN/ 301 +} + +http://mirror.sjtu.edu.cn/CTAN/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /CTAN + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CTAN{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/ctan { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ctan /ctan/ 301 +} + +http://mirror.sjtu.edu.cn/ctan/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ctan + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ctan{uri} 302 + } +} + +http://mirror.sjtu.edu.cn/rocky { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /rocky /rocky/ 301 +} + +http://mirror.sjtu.edu.cn/rocky/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /rocky + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/rocky{uri} 302 + } +} + http://mirror.sjtu.edu.cn/speedtest { redir /speedtest /speedtest/ 308 log { @@ -797,72 +1443,72 @@ mirror.sjtu.edu.cn { redir /putty /putty/ 301 route /putty/* { uri strip_prefix /putty - redir * https://mirrors.sjtug.sjtu.edu.cn/putty{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/putty{uri} 302 } redir /archlinux-cn /archlinux-cn/ 301 route /archlinux-cn/* { uri strip_prefix /archlinux-cn - redir * https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/archlinux-cn{uri} 302 } redir /archlinuxarm /archlinuxarm/ 301 route /archlinuxarm/* { uri strip_prefix /archlinuxarm - redir * https://mirrors.sjtug.sjtu.edu.cn/archlinuxarm{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/archlinuxarm{uri} 302 } redir /gentoo /gentoo/ 301 route /gentoo/* { uri strip_prefix /gentoo - redir * https://mirrors.sjtug.sjtu.edu.cn/gentoo{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/gentoo{uri} 302 } redir /vim /vim/ 301 route /vim/* { uri strip_prefix /vim - redir * https://mirrors.sjtug.sjtu.edu.cn/vim{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/vim{uri} 302 } redir /alpine /alpine/ 301 route /alpine/* { uri strip_prefix /alpine - redir * https://mirrors.sjtug.sjtu.edu.cn/alpine{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/alpine{uri} 302 } redir /cpan /cpan/ 301 route /cpan/* { uri strip_prefix /cpan - redir * https://mirrors.sjtug.sjtu.edu.cn/cpan{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cpan{uri} 302 } redir /cran /cran/ 301 route /cran/* { uri strip_prefix /cran - redir * https://mirrors.sjtug.sjtu.edu.cn/cran{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cran{uri} 302 } redir /ctex /ctex/ 301 route /ctex/* { uri strip_prefix /ctex - redir * https://mirrors.sjtug.sjtu.edu.cn/ctex{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ctex{uri} 302 } redir /gnu /gnu/ 301 route /gnu/* { uri strip_prefix /gnu - redir * https://mirrors.sjtug.sjtu.edu.cn/gnu{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/gnu{uri} 302 } redir /cygwin /cygwin/ 301 route /cygwin/* { uri strip_prefix /cygwin - redir * https://mirrors.sjtug.sjtu.edu.cn/cygwin{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/cygwin{uri} 302 } redir /ros /ros/ 301 route /ros/* { uri strip_prefix /ros - redir * https://mirrors.sjtug.sjtu.edu.cn/ros{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ros{uri} 302 } redir /kali /kali/ 301 route /kali/* { uri strip_prefix /kali - redir * https://mirrors.sjtug.sjtu.edu.cn/kali{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/kali{uri} 302 } redir /kali-images /kali-images/ 301 route /kali-images/* { uri strip_prefix /kali-images - redir * https://mirrors.sjtug.sjtu.edu.cn/kali-images{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/kali-images{uri} 302 } redir /git/homebrew-core.git /git/homebrew-core.git/ 301 redir /git/homebrew-cask.git /git/homebrew-cask.git/ 301 @@ -871,79 +1517,79 @@ mirror.sjtu.edu.cn { redir /raspbian /raspbian/ 301 route /raspbian/* { uri strip_prefix /raspbian - redir * https://mirrors.sjtug.sjtu.edu.cn/raspbian{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspbian{uri} 302 } redir /parrot /parrot/ 301 route /parrot/* { uri strip_prefix /parrot - redir * https://mirrors.sjtug.sjtu.edu.cn/parrot{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/parrot{uri} 302 } redir /raspberrypi /raspberrypi/ 301 route /raspberrypi/* { uri strip_prefix /raspberrypi - redir * https://mirrors.sjtug.sjtu.edu.cn/raspberrypi{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspberrypi{uri} 302 } redir /mx-isos /mx-isos/ 301 route /mx-isos/* { uri strip_prefix /mx-isos - redir * https://mirrors.sjtug.sjtu.edu.cn/mx-isos{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mx-isos{uri} 302 } redir /mx-packages /mx-packages/ 301 route /mx-packages/* { uri strip_prefix /mx-packages - redir * https://mirrors.sjtug.sjtu.edu.cn/mx-packages{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mx-packages{uri} 302 } redir /packagist /packagist/ 301 route /packagist/* { uri strip_prefix /packagist - redir * https://mirrors.sjtug.sjtu.edu.cn/packagist{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/packagist{uri} 302 } redir /mongodb /mongodb/ 301 route /mongodb/* { uri strip_prefix /mongodb - redir * https://mirrors.sjtug.sjtu.edu.cn/mongodb{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/mongodb{uri} 302 } redir /qt /qt/ 301 route /qt/* { uri strip_prefix /qt - redir * https://mirrors.sjtug.sjtu.edu.cn/qt{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/qt{uri} 302 } redir /julia /julia/ 301 route /julia/* { uri strip_prefix /julia - redir * https://mirrors.sjtug.sjtu.edu.cn/julia{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/julia{uri} 302 } redir /emacs-elpa /emacs-elpa/ 301 route /emacs-elpa/* { uri strip_prefix /emacs-elpa - redir * https://mirrors.sjtug.sjtu.edu.cn/emacs-elpa{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/emacs-elpa{uri} 302 } redir /julia-releases /julia-releases/ 301 route /julia-releases/* { uri strip_prefix /julia-releases - redir * https://mirrors.sjtug.sjtu.edu.cn/julia-releases{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/julia-releases{uri} 302 } redir /raspberry-pi-os-images /raspberry-pi-os-images/ 301 route /raspberry-pi-os-images/* { uri strip_prefix /raspberry-pi-os-images - redir * https://mirrors.sjtug.sjtu.edu.cn/raspberry-pi-os-images{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/raspberry-pi-os-images{uri} 302 } redir /msys2 /msys2/ 301 route /msys2/* { uri strip_prefix /msys2 - redir * https://mirrors.sjtug.sjtu.edu.cn/msys2{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/msys2{uri} 302 } redir /git/opam-repository.git /git/opam-repository.git/ 301 redir /git/qemu.git /git/qemu.git/ 301 redir /linuxliteos /linuxliteos/ 301 route /linuxliteos/* { uri strip_prefix /linuxliteos - redir * https://mirrors.sjtug.sjtu.edu.cn/linuxliteos{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/linuxliteos{uri} 302 } redir /download.flutter.io /download.flutter.io/ 301 route /download.flutter.io/* { uri strip_prefix /download.flutter.io - redir * https://mirrors.sjtug.sjtu.edu.cn/download.flutter.io{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/download.flutter.io{uri} 302 } redir /google-fonts /google-fonts/ 301 route /google-fonts/* { @@ -953,27 +1599,27 @@ mirror.sjtu.edu.cn { redir /CPAN /CPAN/ 301 route /CPAN/* { uri strip_prefix /CPAN - redir * https://mirrors.sjtug.sjtu.edu.cn/CPAN{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CPAN{uri} 302 } redir /CRAN /CRAN/ 301 route /CRAN/* { uri strip_prefix /CRAN - redir * https://mirrors.sjtug.sjtu.edu.cn/CRAN{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CRAN{uri} 302 } redir /CTAN /CTAN/ 301 route /CTAN/* { uri strip_prefix /CTAN - redir * https://mirrors.sjtug.sjtu.edu.cn/CTAN{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/CTAN{uri} 302 } redir /ctan /ctan/ 301 route /ctan/* { uri strip_prefix /ctan - redir * https://mirrors.sjtug.sjtu.edu.cn/ctan{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/ctan{uri} 302 } redir /rocky /rocky/ 301 route /rocky/* { uri strip_prefix /rocky - redir * https://mirrors.sjtug.sjtu.edu.cn/rocky{uri} 302 + redir * {scheme}://mirrors.sjtug.sjtu.edu.cn/rocky{uri} 302 } @git_libgit2 { diff --git a/caddy/Caddyfile.zhiyuan b/caddy/Caddyfile.zhiyuan index ec6ccb29..60447fff 100644 --- a/caddy/Caddyfile.zhiyuan +++ b/caddy/Caddyfile.zhiyuan @@ -168,6 +168,766 @@ http://mirrors.sjtug.sjtu.edu.cn/ctan/* { header * x-sjtug-mirror-id zhiyuan } +http://mirrors.sjtug.sjtu.edu.cn/centos { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /centos /centos/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/centos/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /centos + redir * {scheme}://mirror.sjtu.edu.cn/centos{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/debian { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /debian /debian/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/debian/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /debian + redir * {scheme}://mirror.sjtu.edu.cn/debian{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-cd { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /debian-cd /debian-cd/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-cd/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /debian-cd + redir * {scheme}://mirror.sjtu.edu.cn/debian-cd{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-security { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /debian-security /debian-security/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-security/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /debian-security + redir * {scheme}://mirror.sjtu.edu.cn/debian-security{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/deepin { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /deepin /deepin/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/deepin/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /deepin + redir * {scheme}://mirror.sjtu.edu.cn/deepin{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/deepin-cd { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /deepin-cd /deepin-cd/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/deepin-cd/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /deepin-cd + redir * {scheme}://mirror.sjtu.edu.cn/deepin-cd{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/docker-ce { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /docker-ce /docker-ce/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/docker-ce/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /docker-ce + redir * {scheme}://mirror.sjtu.edu.cn/docker-ce{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/fedora-secondary { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /fedora-secondary /fedora-secondary/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/fedora-secondary/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /fedora-secondary + redir * {scheme}://mirror.sjtu.edu.cn/fedora-secondary{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/linuxmint { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /linuxmint /linuxmint/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/linuxmint/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /linuxmint + redir * {scheme}://mirror.sjtu.edu.cn/linuxmint{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/linuxmint-cd { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /linuxmint-cd /linuxmint-cd/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/linuxmint-cd/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /linuxmint-cd + redir * {scheme}://mirror.sjtu.edu.cn/linuxmint-cd{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/mageia { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /mageia /mageia/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/mageia/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /mageia + redir * {scheme}://mirror.sjtu.edu.cn/mageia{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/opensuse { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /opensuse /opensuse/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/opensuse/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /opensuse + redir * {scheme}://mirror.sjtu.edu.cn/opensuse{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/openvz { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /openvz /openvz/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/openvz/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /openvz + redir * {scheme}://mirror.sjtu.edu.cn/openvz{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/remi { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /remi /remi/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/remi/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /remi + redir * {scheme}://mirror.sjtu.edu.cn/remi{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/scientific { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /scientific /scientific/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/scientific/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /scientific + redir * {scheme}://mirror.sjtu.edu.cn/scientific{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntu /ubuntu/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntu + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cd { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntu-cd /ubuntu-cd/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cd/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntu-cd + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cd{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cdimage { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntu-cdimage /ubuntu-cdimage/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cdimage/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntu-cdimage + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cdimage{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-ports { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntu-ports /ubuntu-ports/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-ports/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntu-ports + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-ports{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/openwrt { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /openwrt /openwrt/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/openwrt/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /openwrt + redir * {scheme}://mirror.sjtu.edu.cn/openwrt{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/rpmfusion { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /rpmfusion /rpmfusion/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/rpmfusion/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /rpmfusion + redir * {scheme}://mirror.sjtu.edu.cn/rpmfusion{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/apache { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /apache /apache/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/apache/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /apache + redir * {scheme}://mirror.sjtu.edu.cn/apache{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/blackarch { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /blackarch /blackarch/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/blackarch/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /blackarch + redir * {scheme}://mirror.sjtu.edu.cn/blackarch{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/sites/tldp.org { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /sites/tldp.org /sites/tldp.org/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/sites/tldp.org/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /sites/tldp.org + redir * {scheme}://mirror.sjtu.edu.cn/sites/tldp.org{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/sury { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /sury /sury/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/sury/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /sury + redir * {scheme}://mirror.sjtu.edu.cn/sury{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/dragonflybsd { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /dragonflybsd /dragonflybsd/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/dragonflybsd/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /dragonflybsd + redir * {scheme}://mirror.sjtu.edu.cn/dragonflybsd{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/openeuler { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /openeuler /openeuler/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/openeuler/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /openeuler + redir * {scheme}://mirror.sjtu.edu.cn/openeuler{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/fedora { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /fedora /fedora/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/fedora/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /fedora + redir * {scheme}://mirror.sjtu.edu.cn/fedora{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/manjaro { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /manjaro /manjaro/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/manjaro/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /manjaro + redir * {scheme}://mirror.sjtu.edu.cn/manjaro{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/archlinux { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /archlinux /archlinux/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/archlinux/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /archlinux + redir * {scheme}://mirror.sjtu.edu.cn/archlinux{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/test { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /test /test/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/test/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /test + redir * {scheme}://mirror.sjtu.edu.cn/test{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/armbian { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /armbian /armbian/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/armbian/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /armbian + redir * {scheme}://mirror.sjtu.edu.cn/armbian{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/almalinux { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /almalinux /almalinux/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/almalinux/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /almalinux + redir * {scheme}://mirror.sjtu.edu.cn/almalinux{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/raspbian-addons { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /raspbian-addons /raspbian-addons/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/raspbian-addons/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /raspbian-addons + redir * {scheme}://mirror.sjtu.edu.cn/raspbian-addons{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/OpenBSD { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /OpenBSD /OpenBSD/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/OpenBSD/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /OpenBSD + redir * {scheme}://mirror.sjtu.edu.cn/OpenBSD{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntukylin-cdimage { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntukylin-cdimage /ubuntukylin-cdimage/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntukylin-cdimage/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntukylin-cdimage + redir * {scheme}://mirror.sjtu.edu.cn/ubuntukylin-cdimage{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntukylin { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntukylin /ubuntukylin/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntukylin/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntukylin + redir * {scheme}://mirror.sjtu.edu.cn/ubuntukylin{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/zorinos-isos { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /zorinos-isos /zorinos-isos/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/zorinos-isos/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /zorinos-isos + redir * {scheme}://mirror.sjtu.edu.cn/zorinos-isos{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cloud-images { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /ubuntu-cloud-images /ubuntu-cloud-images/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/ubuntu-cloud-images/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /ubuntu-cloud-images + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cloud-images{uri} 302 + } +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-ports { + log { + output stdout + format single_field common_log # log in v1 style + } + redir /debian-ports /debian-ports/ 301 +} + +http://mirrors.sjtug.sjtu.edu.cn/debian-ports/* { + log { + output stdout + format single_field common_log # log in v1 style + } + route * { + uri strip_prefix /debian-ports + redir * {scheme}://mirror.sjtu.edu.cn/debian-ports{uri} 302 + } +} + http://mirrors.sjtug.sjtu.edu.cn/speedtest { redir /speedtest /speedtest/ 308 log { @@ -441,107 +1201,107 @@ mirrors.sjtug.sjtu.edu.cn { redir /centos /centos/ 301 route /centos/* { uri strip_prefix /centos - redir * https://mirror.sjtu.edu.cn/centos{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/centos{uri} 302 } redir /debian /debian/ 301 route /debian/* { uri strip_prefix /debian - redir * https://mirror.sjtu.edu.cn/debian{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/debian{uri} 302 } redir /debian-cd /debian-cd/ 301 route /debian-cd/* { uri strip_prefix /debian-cd - redir * https://mirror.sjtu.edu.cn/debian-cd{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/debian-cd{uri} 302 } redir /debian-security /debian-security/ 301 route /debian-security/* { uri strip_prefix /debian-security - redir * https://mirror.sjtu.edu.cn/debian-security{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/debian-security{uri} 302 } redir /deepin /deepin/ 301 route /deepin/* { uri strip_prefix /deepin - redir * https://mirror.sjtu.edu.cn/deepin{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/deepin{uri} 302 } redir /deepin-cd /deepin-cd/ 301 route /deepin-cd/* { uri strip_prefix /deepin-cd - redir * https://mirror.sjtu.edu.cn/deepin-cd{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/deepin-cd{uri} 302 } redir /docker-ce /docker-ce/ 301 route /docker-ce/* { uri strip_prefix /docker-ce - redir * https://mirror.sjtu.edu.cn/docker-ce{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/docker-ce{uri} 302 } redir /fedora-secondary /fedora-secondary/ 301 route /fedora-secondary/* { uri strip_prefix /fedora-secondary - redir * https://mirror.sjtu.edu.cn/fedora-secondary{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/fedora-secondary{uri} 302 } redir /linuxmint /linuxmint/ 301 route /linuxmint/* { uri strip_prefix /linuxmint - redir * https://mirror.sjtu.edu.cn/linuxmint{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/linuxmint{uri} 302 } redir /linuxmint-cd /linuxmint-cd/ 301 route /linuxmint-cd/* { uri strip_prefix /linuxmint-cd - redir * https://mirror.sjtu.edu.cn/linuxmint-cd{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/linuxmint-cd{uri} 302 } redir /mageia /mageia/ 301 route /mageia/* { uri strip_prefix /mageia - redir * https://mirror.sjtu.edu.cn/mageia{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/mageia{uri} 302 } redir /opensuse /opensuse/ 301 route /opensuse/* { uri strip_prefix /opensuse - redir * https://mirror.sjtu.edu.cn/opensuse{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/opensuse{uri} 302 } redir /openvz /openvz/ 301 route /openvz/* { uri strip_prefix /openvz - redir * https://mirror.sjtu.edu.cn/openvz{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/openvz{uri} 302 } redir /remi /remi/ 301 route /remi/* { uri strip_prefix /remi - redir * https://mirror.sjtu.edu.cn/remi{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/remi{uri} 302 } redir /scientific /scientific/ 301 route /scientific/* { uri strip_prefix /scientific - redir * https://mirror.sjtu.edu.cn/scientific{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/scientific{uri} 302 } redir /ubuntu /ubuntu/ 301 route /ubuntu/* { uri strip_prefix /ubuntu - redir * https://mirror.sjtu.edu.cn/ubuntu{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu{uri} 302 } redir /ubuntu-cd /ubuntu-cd/ 301 route /ubuntu-cd/* { uri strip_prefix /ubuntu-cd - redir * https://mirror.sjtu.edu.cn/ubuntu-cd{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cd{uri} 302 } redir /ubuntu-cdimage /ubuntu-cdimage/ 301 route /ubuntu-cdimage/* { uri strip_prefix /ubuntu-cdimage - redir * https://mirror.sjtu.edu.cn/ubuntu-cdimage{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cdimage{uri} 302 } redir /ubuntu-ports /ubuntu-ports/ 301 route /ubuntu-ports/* { uri strip_prefix /ubuntu-ports - redir * https://mirror.sjtu.edu.cn/ubuntu-ports{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-ports{uri} 302 } redir /openwrt /openwrt/ 301 route /openwrt/* { uri strip_prefix /openwrt - redir * https://mirror.sjtu.edu.cn/openwrt{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/openwrt{uri} 302 } redir /rpmfusion /rpmfusion/ 301 route /rpmfusion/* { uri strip_prefix /rpmfusion - redir * https://mirror.sjtu.edu.cn/rpmfusion{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/rpmfusion{uri} 302 } redir /homebrew-bottles /homebrew-bottles/ 301 route /homebrew-bottles/* { @@ -590,7 +1350,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /apache /apache/ 301 route /apache/* { uri strip_prefix /apache - redir * https://mirror.sjtu.edu.cn/apache{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/apache{uri} 302 } redir /git/ohmyzsh.git /git/ohmyzsh.git/ 301 redir /git/spacemacs.git /git/spacemacs.git/ 301 @@ -598,7 +1358,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /blackarch /blackarch/ 301 route /blackarch/* { uri strip_prefix /blackarch - redir * https://mirror.sjtu.edu.cn/blackarch{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/blackarch{uri} 302 } redir /github/GNS3 /github/GNS3/ 301 route /github/GNS3/* { @@ -628,7 +1388,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /sites/tldp.org /sites/tldp.org/ 301 route /sites/tldp.org/* { uri strip_prefix /sites/tldp.org - redir * https://mirror.sjtu.edu.cn/sites/tldp.org{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/sites/tldp.org{uri} 302 } redir /nix-channels/store /nix-channels/store/ 301 route /nix-channels/store/* { @@ -676,7 +1436,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /sury /sury/ 301 route /sury/* { uri strip_prefix /sury - redir * https://mirror.sjtu.edu.cn/sury{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/sury{uri} 302 } redir /opam-cache /opam-cache/ 301 route /opam-cache/* { @@ -694,23 +1454,23 @@ mirrors.sjtug.sjtu.edu.cn { redir /dragonflybsd /dragonflybsd/ 301 route /dragonflybsd/* { uri strip_prefix /dragonflybsd - redir * https://mirror.sjtu.edu.cn/dragonflybsd{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/dragonflybsd{uri} 302 } redir /git/homebrew-install.git /git/homebrew-install.git/ 301 redir /openeuler /openeuler/ 301 route /openeuler/* { uri strip_prefix /openeuler - redir * https://mirror.sjtu.edu.cn/openeuler{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/openeuler{uri} 302 } redir /fedora /fedora/ 301 route /fedora/* { uri strip_prefix /fedora - redir * https://mirror.sjtu.edu.cn/fedora{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/fedora{uri} 302 } redir /manjaro /manjaro/ 301 route /manjaro/* { uri strip_prefix /manjaro - redir * https://mirror.sjtu.edu.cn/manjaro{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/manjaro{uri} 302 } redir /manjarostable /manjarostable/ 301 route /manjarostable/* { @@ -724,7 +1484,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /archlinux /archlinux/ 301 route /archlinux/* { uri strip_prefix /archlinux - redir * https://mirror.sjtu.edu.cn/archlinux{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/archlinux{uri} 302 } redir /bioconductor /bioconductor/ 301 route /bioconductor/* { @@ -737,7 +1497,7 @@ mirrors.sjtug.sjtu.edu.cn { redir /test /test/ 301 route /test/* { uri strip_prefix /test - redir * https://mirror.sjtu.edu.cn/test{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/test{uri} 302 } redir /macports /macports/ 301 route /macports/* { @@ -760,12 +1520,12 @@ mirrors.sjtug.sjtu.edu.cn { redir /armbian /armbian/ 301 route /armbian/* { uri strip_prefix /armbian - redir * https://mirror.sjtu.edu.cn/armbian{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/armbian{uri} 302 } redir /almalinux /almalinux/ 301 route /almalinux/* { uri strip_prefix /almalinux - redir * https://mirror.sjtu.edu.cn/almalinux{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/almalinux{uri} 302 } redir /kernel /kernel/ 301 route /kernel/* { @@ -775,37 +1535,37 @@ mirrors.sjtug.sjtu.edu.cn { redir /raspbian-addons /raspbian-addons/ 301 route /raspbian-addons/* { uri strip_prefix /raspbian-addons - redir * https://mirror.sjtu.edu.cn/raspbian-addons{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/raspbian-addons{uri} 302 } redir /OpenBSD /OpenBSD/ 301 route /OpenBSD/* { uri strip_prefix /OpenBSD - redir * https://mirror.sjtu.edu.cn/OpenBSD{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/OpenBSD{uri} 302 } redir /ubuntukylin-cdimage /ubuntukylin-cdimage/ 301 route /ubuntukylin-cdimage/* { uri strip_prefix /ubuntukylin-cdimage - redir * https://mirror.sjtu.edu.cn/ubuntukylin-cdimage{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntukylin-cdimage{uri} 302 } redir /ubuntukylin /ubuntukylin/ 301 route /ubuntukylin/* { uri strip_prefix /ubuntukylin - redir * https://mirror.sjtu.edu.cn/ubuntukylin{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntukylin{uri} 302 } redir /zorinos-isos /zorinos-isos/ 301 route /zorinos-isos/* { uri strip_prefix /zorinos-isos - redir * https://mirror.sjtu.edu.cn/zorinos-isos{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/zorinos-isos{uri} 302 } redir /ubuntu-cloud-images /ubuntu-cloud-images/ 301 route /ubuntu-cloud-images/* { uri strip_prefix /ubuntu-cloud-images - redir * https://mirror.sjtu.edu.cn/ubuntu-cloud-images{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/ubuntu-cloud-images{uri} 302 } redir /debian-ports /debian-ports/ 301 route /debian-ports/* { uri strip_prefix /debian-ports - redir * https://mirror.sjtu.edu.cn/debian-ports{uri} 302 + redir * {scheme}://mirror.sjtu.edu.cn/debian-ports{uri} 302 } redir /git/homebrew-bundle.git /git/homebrew-bundle.git/ 301 redir /git/spdk.git /git/spdk.git/ 301