diff --git a/conf/nginx.conf b/conf/nginx.conf index c7ddbcc..c3fd55f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -44,12 +44,12 @@ http { return 301 http://miti.sh$request_uri; } - location ~ ^/git/(.*)$ { - return 301 https://git.miti.sh/ccm/$1; + location ~ ^/git/?(.*)$ { + return 301 http://git.miti.sh/ccm/$1; } location ~ ^/apps/(.*)$ { - return 301 https://apps.miti.sh/$1; + return 301 http://apps.miti.sh/$1; } } } diff --git a/spec/routes_spec.moon b/spec/routes_spec.moon index 9c9e21f..6e3bf0f 100644 --- a/spec/routes_spec.moon +++ b/spec/routes_spec.moon @@ -16,17 +16,24 @@ describe "http://webdevcat.me", -> assert.same request\header!.Location, "http://miti.sh/" describe "http://webdevcat.me/git", -> - it "permanently redirects to http://git.miti.sh", -> + it "permanently redirects to http://git.miti.sh/ccm/", -> request = req "http://webdevcat.me/git" - assert.same request\header!.Location, "http://git.miti.sh/" + assert.same request\header!.Location, "http://git.miti.sh/ccm/" describe "http://webdevcat.me/git/", -> it "permanently redirects to http://git.miti.sh", -> request = req "http://webdevcat.me/git" - assert.same request\header!.Location, "http://git.miti.sh/" + assert.same request\header!.Location, "http://git.miti.sh/ccm/" -describe "http://webdevcat.me/git/pandoc/", -> - pending "permanently redirects to http://git.miti.sh/ccm/pandoc" +describe "http://webdevcat.me/git/pandoc", -> + it "permanently redirects to http://git.miti.sh/ccm/pandoc", -> + request = req "http://webdevcat.me/git/pandoc" + assert.same request\header!.Location, "http://git.miti.sh/ccm/pandoc" + +describe "http://webdevcat.me/apps/btroops", -> + it "permanently redirects to http://apps.miti.sh/btroops", -> + request = req "http://webdevcat.me/apps/btroops" + assert.same request\header!.Location, "http://apps.miti.sh/btroops" describe "http://miti.sh", -> it "sends /index.html", ->