-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2: add one server route config will effect all server route #2938
Comments
Today I use two caddy server to resolve this problem, one reverse proxy another caddy amin api and manager that, one do the normal caddy server work |
caddy2 beta11 still have this problem |
Thanks for the issue! I was able to follow your instructions so I think I understand what is happening. But can you explain what the problem is? I don't understand. Although, you do mention that I haven't looked in too much detail yet but my guess is that the admin endpoint (2019) is trying to close the config which runs the proxy endpoint (2020), but the proxy endpoint is waiting for the admin endpoint (2019) to close so that it can write the response back to the client. It's a standoff: one cannot gracefully close without forcefully closing the other. So your config appears to create a contradiction. A graceful shutdown is impossible. Can I ask... why are you doing this? Or better yet, why do you need to do this? |
I try to write a web ui to manager caddy2 server, use reverse_proxy admin api the web ui can manager caddy2 server , but it can not manager itself because this problem will make proxy api request connection reset and browser return a error for this api request |
So, as I said before, I think the crux of this issue is that the admin endpoint, when instigating a config reload, has to wait for the http app, which contains the HTTP server with all your custom routes and stuff, to finish shutting down. If the http app is itself serving the admin endpoint, both are waiting for the other to finish before returning, so you have a deadlock. I am not convinced this kind of configuration is necessary/useful either. There is almost surely another way to do what you're trying to do (which still isn't clear to me). |
I use
reverse_proxy
andrewrite
handle to proxy admin rest api endpointlocalhost:2019
as pathlocalhost:2020/caddy2-api
, then I use the endpoint'localhost:2020/caddy2-api
to add route for other server and will wait the connection reply foroverthe step to report
save the below content to
caddy.json
, andcaddy2 run -config caddy.json
, then use the last section curl code check this problemGet the first route from
example-sever
Add Route to
example-sever
Del Route from
example-sever
The text was updated successfully, but these errors were encountered: