Caddy in Docker: failed to sufficiently increase receive buffer size

efstajasPRO

10 months ago

I'm trying to host a very simple caddy server on Railway using the official caddy:alpine image. It's intended to act as a reverse proxy for our frontend server running in a separate node VPS on railway, that also rewrites URLs to include www.

You can find the caddy & dockerfile here: https://github.com/drips-network/caddy/tree/main

It starts up fine, except that during the startup process it logs this:

```failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.```

Not sure why & how to fix it. Was able to find a few possible fixes online but they all seem to point at needing to change configuration on the host OS, which I obviously can't.

Solved

7 Replies

10 months ago

Will attempt to reproduce.


10 months ago

Was easily reproducible, and I have submitted a PR to get that Caddyfile into a working state - https://github.com/drips-network/caddy/pull/1

Notes:

  • You where attempting to redirect caddy-mainnet.up.railway.app to caddy-mainnet.up.railway.app if caddy started, this would have caused an infinite redirect.

  • In the first handler block I'm assuming you meant to redirect to a domain with www as the second block handles, so I've changed the redirect in the first block to include www.

  • You can't have an www.caddy-mainnet.up.railway.app as Railway doesn't let you have a subdomain on a subdomain, so I opted for www- instead, which serves the same purpose.

  • When proxying to an internal service you need to specify the port the same way you would on a local network as that's basically what the private network is.

  • Even though you had auto_https off you still specified domains without a schema meaning Caddy would attempt to listen on https without SSL, instead we need to explicitly specify http and the port for the handler blocks.

If you have any more questions, let me know! the domains used in my Caddyfile are going to still be live for the day so feel free to test!


efstajasPRO

10 months ago

Wow, thanks so much for fixing everything! As you can probably tell, this was my first time just messing around with caddy. You just saved me a ton of time.


Status changed to Awaiting Railway Response railway[bot] 10 months ago


10 months ago

Happy to help! I'll keep this thread open for a few days incase you have any more questions about the topic.


efstajasPRO

10 months ago

This might be unrelated, but after deploying your changes, it just returns "Unexpected error from Railway Proxy". https://caddy-mainnet.up.railway.app/

I already tried disabling "Edge Proxy", but nothing changed. No error logs in the container output.


10 months ago

That means it's an empty 404 response, that could be a bad thing or a good thing, for example it's plenty normal for an API to return 404 on the route route.

The message about the unexpected error from Railway proxy is strange and I will report that, but can be ignored for now.

Additionally, enabling / disabling the edge proxy is a DNS update and thus it takes time, but I'd keep it on because it's fine, just an odd message.


efstajasPRO

10 months ago

Got it. I can figure things out from here. Thanks again!


Status changed to Solved christian 10 months ago