I’m trying to set up HAProxy, but I only need it for URL redirects. I don’t want to define any backend servers since I’m not proxying traffic to other services. Is there a way to make HAProxy work in this setup without it complaining about missing backends? I just want to redirect users from one URL to another without HAProxy throwing errors about not having backend servers configured. Has anyone done something like this before? What’s the proper configuration approach for a redirect-only HAProxy setup that doesn’t require backend definitions?
for sure! you can totally do that. just set up http-request redirect in the frontend and leave out the backends. i’ve tried this and it works perfectly for simple redirects! no errors, no hassle.
Yes, HAProxy works fine without backends if you’re only doing redirects. Just put your redirect rules straight in the frontend config and skip the default backend entirely. Use redirect location or redirect prefix in your frontend section. The catch? Every request path needs a matching redirect rule. Miss one and HAProxy will try routing to a backend that doesn’t exist, throwing errors. This setup’s perfect for URL rewrites and domain migrations. Just make sure you test every possible request pattern so nothing gets left unmapped.
Interesting setup! Quick question - what happens with health checks here? Does HAProxy still try to run them without backends defined? Also, have you tested POST requests or requests with special headers? Do they redirect cleanly?