Multiple instances in 1 raspberry

What is the problem?

I can't access the 2nd instance, I get error 404
or
Access octopi through the settings in haproxy, but it is always the same instance, even changing IP, Port and Home Directory.

What did you already try to solve it?

1°- I recorded a Sd card configuration from scratch without changes.

2°- I copied the folder: "/home/pi/.octoprint/" to "/home/pi/.octoprint2/"

3°- I copied the file "/etc/systemd/system/octoprint.service" to "/etc/systemd/system/octoprint2.service"

4°- with "nano" I edited the file "octoprint2.service" with the following change: "ExecStart=/home/pi/oprint/bin/octoprint serve --host=${HOST} --port=${PORT} --config /home/pi/.octoprint2/config.yaml --basedir /home/pi/.octoprint2"

5°- with nano I edited the file "/etc/haproxy/haproxy.cfg" with the following change: "frontend public
```

bind :::80 v4v6
bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem
option forwardfor except 127.0.0.1
use_backend webcam if { path_beg /webcam/ }
use_backend octoprint2 if { path_beg /octoprint2/ }
use_backend webcam_hls if { path_beg /hls/ }
use_backend webcam_hls if { path_beg /jpeg/ }
default_backend octoprint

octoprint backend
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0

    reqrep ^([^\ :]*)\ /(.*) \1\ /\2
    reqadd X-Scheme:\ https if needs_scheme { ssl_fc }
    reqadd X-Scheme:\ http if needs_scheme !{ ssl_fc }
    option forwardfor
    server octoprint1 127.0.0.1:5000
    errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

octoprint2 backend
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0

    reqrep ^([^\ :]*)\ /octoprint2/(.*) \1\ /\2
    reqadd X-Scheme:\ https if needs_scheme { ssl_fc }
    reqadd X-Scheme:\ http if needs_scheme !{ ssl_fc }
    option forwardfor
    server octoprint1 0.0.0.0:5001
    errorfile 503 /etc/haproxy/errors/503-no-octoprint.http"

6° - I gave the commands:

>
> sudo systemctl enable octoprint2.service
> sudo systemctl start octoprint2.service
> sudo service haproxy reload
> sudo reboot now
> 

### Have you tried running in safe mode?
no

### Did running in safe mode solve the problem?
no

### Systeminfo Bundle
<small>You can download this in OctoPrint's System Information dialog ... **no bundle, no support!**)</small>

WRITE HERE
[octoprint-systeminfo-20220816115319.zip|attachment](upload://yPMNM3JXirDqOPq2EP9IB9687s3.zip) (254.4 KB)


### Additional information about your setup
<small>OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... **as much data as possible**</small>

WRITE HERE

When you are pasting code, terminal commands/responses or anything where formatting is important, please use the preformatted text options to make them render correctly. You can use the </> button for single lines, or for large blocks then you should use 3 backticks to create code blocks.

```
Like this
```

Which will render

Like this

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.