Fix forward_auth in caddy, keep proxy open when run locally
This commit is contained in:
parent
7dd5248a6e
commit
6bd98d6792
@ -6,7 +6,7 @@
|
||||
|
||||
http://*:8888 {
|
||||
forward_auth /admin/* http://127.0.0.1:3000 {
|
||||
uri http://127.0.0.1:3000
|
||||
uri /auth
|
||||
copy_headers {
|
||||
Authorization
|
||||
}
|
||||
|
@ -20,6 +20,13 @@ class Config
|
||||
end
|
||||
|
||||
class ConfigAuthHandler < Kemal::BasicAuth::Handler
|
||||
only ["/auth"]
|
||||
|
||||
def call(context)
|
||||
return call_next(context) unless only_match?(context)
|
||||
super
|
||||
end
|
||||
|
||||
def initialize
|
||||
# Ignored, just make the compiler happy
|
||||
@credentials = Kemal::BasicAuth::Credentials.new({"foo" => "bar"})
|
||||
|
@ -23,6 +23,9 @@ get "/version" do
|
||||
"#{version}"
|
||||
end
|
||||
|
||||
get "/auth" do
|
||||
end
|
||||
|
||||
get "/reload" do
|
||||
Log.info { "Reloading configuration" }
|
||||
Config.load
|
||||
|
@ -37,7 +37,7 @@ module Proxy
|
||||
|
||||
http://*:8888 {
|
||||
forward_auth /admin/* http://127.0.0.1:3000 {
|
||||
uri http://127.0.0.1:3000
|
||||
uri /auth
|
||||
copy_headers {
|
||||
Authorization
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user