Skip to content
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

Use multiple mirror endpoints #37

Open
jvinolas opened this issue Nov 16, 2023 · 1 comment
Open

Use multiple mirror endpoints #37

jvinolas opened this issue Nov 16, 2023 · 1 comment

Comments

@jvinolas
Copy link

Could this be modified (or it's already available) to mirror traffic to multiple servers?

The use case I would like to implement is in an scenario where I've got only one public IP but multiple servers not at default 80/443 port (of course) but want to get them to request and renew letsencrypt certificates. Letsencrypt default certbot renewal method only allows for default ports and executes a get to /.well-know... path to validate dns ownership.

So, if this mirror spoa could mirror this letsencrypt path to all the backend servers I will be able to request and renew them all, as only one of them will reply to the request when doing validation (it's then when the /.well-known.. server path will be available.

Just guessing if possible.

@zaga00
Copy link
Member

zaga00 commented Nov 17, 2023

Hello @jvinolas,

of course, it is possible to mirror to several different URLs. In order for it to work, it is necessary to add as many SPOE mirror filters in the HAProxy configuration as we want different URLs for the mirror. Of course, this means that each mirror filter communicates with its spoa-mirror program (in the example below, there are two of them).

For example, something like this should be written in haproxy.cfg:

frontend spoe-mirror-frontend
    ..
    filter spoe engine mirror-1 config spoe.cfg
    filter spoe engine mirror-2 config spoe.cfg
    ..

backend mirroragents-1
    ..
    server mirror-server-1 127.0.0.1:12345

backend mirroragents-2
    ..
    server mirror-server-2 127.0.0.1:12346

whereas in spoe.cfg something like this should be written:

[mirror-1]
    ..
    use-backend mirroragents-1
    ..

[mirror-2]
    ..
    use-backend mirroragents-2
    ..

And finally, in order for it to work, one spoa-mirror program needs to be started on port 12345 (default) and the other on port 12346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants