Cannot Access OctoPrint Under Same Network

What is the problem?

Cannot access Octoprint from other machines under the same network(both wifi and wired). Can only access it if I open it on my Pi4B or use VSCode server to forward the port.

For example, if I'm on my Pi4B, then 127.0.01:5050 works fine. While if I'm using my PC and 192.168.1.183:5050 then I cannot access Octoprint. Pi-hole is running on 80 and can be accessed from other devices under the same network.

What did you already try to solve it?

I have both pi-hole(docker) and Octoprint running on the same Pi4B. I know there will be issue with port 80 so I used haproxy to change the port of Octoprint to 5050. I guess I need to do something more that haproxy, maybe in Pi-hole? Here's my haproxy.cfg.

global
        maxconn 4096
        user haproxy
        group haproxy
        daemon
        log 127.0.0.1 local0 debug

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        option http-server-close
        option forwardfor
        maxconn 2000
        timeout connect 5s
        timeout client  15m
        timeout server  15m

frontend public
        bind *:5050 v4v6
        use_backend webcam if { path_beg /webcam/ }
        default_backend octoprint

backend octoprint
        http-request replace-path /(.*)     /\1
        option forwardfor
        server octoprint1 127.0.0.1:5000
        acl AuthOkay http_auth(L1)
        http-request auth realm octoprint if !AuthOkay

backend webcam
        http-request replace-path /webcam/(.*)     /\1
        server webcam1  127.0.0.1:8080

I can use VSCode ssh port forwarding to use OctoPrint but eventually I want to solve the problem...

Systeminfo Bundle

octoprint-systeminfo-20211211171100.zip (3.7 KB)

Additional information about your setup

  • Pi4B
    • Manjaro ARM
      • Docker - Pi-hole
      • OctoPrint 1.7.2

no printer yet(on the way to my front door)
PC: Win10 21H2, Chrome 96

Thanks in advance for any suggestions.

Hello,
there is no frontend or backend configuration in your haproxy.cfg
The Search will find you many examples and deicussions about configuration of haproxy with octoprint.
If it interests you here is the haproxy configuration used by octopi and here Reverse proxy configuration examples

Running OctoPrint on Manjaro on docker with pihole on the same box is far from the typical setup. You can have a lot of fun and will learn plenty getting it to run off the beaten track.

Personally I run Arch on the desktop but prefer debian or derivatives with less frequent updates on servers.

Hey thanks. And yeah I know my sulotion is not the best(easiest way), and I didn't say it clearly I guess.

I ran Manjaro on my Pi4B, and have a docker with a few containers running on Manjaro. Pi-hole is one of them. Then I installed OctoPrint on Manjaro(it's not in docker environment).

I have those lines in my haproxy.cfg, are they the front/backend config you are referring to? I followed the guide from the donwload page of OctoPrint and found them in one of the community post.

frontend public
        bind *:5050 v4v6
        use_backend webcam if { path_beg /webcam/ }
        default_backend octoprint

backend octoprint
        http-request replace-path /(.*)     /\1
        option forwardfor
        server octoprint1 127.0.0.1:5000
        acl AuthOkay http_auth(L1)
        http-request auth realm octoprint if !AuthOkay

backend webcam
        http-request replace-path /webcam/(.*)     /\1
        server webcam1  127.0.0.1:8080

my bad, I overlooked it

does manjaro have some form of firewall software running that blocks the ports to external connections?

oh, and you're using port 5050, is your command line to start OctoPrint also defining the port 5050 rather than the default port 5000?

octoprint serve --port 5050

Edit: Ignore this one, I see the haproxy is doing the forwarding. But I question why you even need that, just use OctoPrint and no haproxy and just go to the address http://:5000/

I thought 80 is used by Pi-hole so it will be I changed 80 to 5050. Neither of them can be accessed under the same local network, unless I use port forwarding after ssh connected or I'm actually using my Pi4 itself.

I guess there might be some settings I need change but searched for a while and didn't find anything helpful lel

Still could not figure out the problem. Also tried ufw to allow the port but didn't work on local network.
The wired thing is everything works fine if I'm on my Pi4 itself. There must be something I need change to make the default web server to use other ports...

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