From a26b936989130e8d158f60781faaf6e6f1264452 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 20 Jun 2022 19:48:33 -0500 Subject: [PATCH] Translate some urls in redirect from Gitea to GitHub --- conf.d/git.bbaovanc.com | 4 +++- github-redirect/index.php | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 github-redirect/index.php diff --git a/conf.d/git.bbaovanc.com b/conf.d/git.bbaovanc.com index d202b4f..39204a7 100644 --- a/conf.d/git.bbaovanc.com +++ b/conf.d/git.bbaovanc.com @@ -16,7 +16,9 @@ git.bbaovanc.com { @404 status 404 handle_response @404 { handle /bbaovanc/* { - redir https://github.com{uri} permanent + root * /etc/caddy/github-redirect/ + rewrite * /index.php?uri={uri} + php_fastcgi unix//run/php/php-fpm.sock } handle { diff --git a/github-redirect/index.php b/github-redirect/index.php new file mode 100644 index 0000000..38163b6 --- /dev/null +++ b/github-redirect/index.php @@ -0,0 +1,7 @@ +