Multiple instances with haproxy 2

I started with Octopi64 1.0.0 and have two octoprint server running on one Rpi. My problem is that the configurations for older haproxy versions don't work. They have changed a few things. reqadd and reqrep bringing errors. I tried to change it to http-request. But from:

reqadd X-Script-Name:\ /Ender7

to

http-request add-header X-Script-Name:\ / Ender7

It hangs the haproxy with following error:

parsing [/etc/haproxy/haproxy.cfg:50] : error detected in backend 'Ender7' while parsing 'http-request add-header' rule : expects exactly 2 arguments.

I have no idea to fix.

You seem to have introduced a space between / and Ender7.

Yes the space was missing. But it has no positive effect.
Here the main part from the haproxy.cfg:

frontend public
bind *:80 v4v6
bind :::443 v4v6 ssl crt /etc/haproxy/certs/mydomain.pem
option forwardfor except 127.0.0.1
use_backend CR10 if { path_beg /CR10/ }
use_backend Ender7 if { path_beg /Ender7/ }
use_backend webcam1 if { path_beg /webcam1/ }
use_backend webcam2 if { path_beg /webcam2/ }
default_backend webcam1

backend Ender7
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
http-request replace-path ^([^\ :])\ /Ender7/(.) \1\ /\2
http-request add-header X-Scheme https if needs_scheme { ssl_fc }
http-request add-header X-Scheme http if needs_scheme !{ ssl_fc }
option forwardfor
server octoprint_1 127.0.0.1:5001
http-request add-header X-Script-Name:\ / Ender7
errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

backend CR10
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
http-request replace-path ^([^\ :])\ /CR10/(.) \1\ /\2
http-request add-header X-Scheme https if needs_scheme { ssl_fc }
http-request add-header X-Scheme http if needs_scheme !{ ssl_fc }
option forwardfor
server octoprint_1 127.0.0.1:5002
http-request add-header X-Script-Name:\ / CR10
errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

backend webcam1
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
http-request replace-path /webcam1/(.*) /\1
server webcam_1 127.0.0.1:8080
errorfile 503 /etc/haproxy/errors/503-no-webcam.http

backend webcam2
http-request replace-path /webcam2/(.*) /\1
server webcam_2 127.0.0.1:8081
errorfile 503 /etc/haproxy/errors/503-no-webcam.http

It may be easier to put your config file in a code block - some of the symbols have meant the formatting is not always correct.

You can do this with three backticks ``` on either side, like this:

```
Config file
```

That will preserve the formatting exactly as you have it in your config file.

I did not say there was a space missing; there is a space too much. Again, there should be no space between / and Ender7. There is a space between / and Ender7 in the main part of haproxy.cfg that you pasted in your reply.

I used it with and without. Without the space he bring the error. When I put the space so he don't bring any error but no two Octoprint.
But I think it's better to go to the stable 32 bit octopi version.

Did you ever get this working, I'm trying to do similar but can't nail down the settings