Octopi change webinterface port


#1

How can i change the webinterface port to something other like 1000?

Im allready hosting a webserver on port 80 wich means that i cant use port 80 for the octopi interface

Greets


#2

normally octoprint runs on port 5000


#3

My interface runs on the default webport 80


#4

Quote:

You'll need to edit /etc/haproxy/haproxy.cfg for that. There are lines that look like this:

frontend public
       bind *:80
       bind 0.0.0.0:443 ssl crt /etc/ssl/snakeoil.pem

You'll need to change the 80 in bind *:80 if you want to change the http port, and the 443 in bind 0.0.0.0:443 ssl crt /etc/ssl/snakeoil.pem if you want to change the https port.

(don't forget to restart service after. I rebooted my Pi.)

As mentioned by @foosel in this post from 2017.

In my case, I removed the bind *:80 to allow a webserver to run, and now I access my OctoPi with https://ip_address instead.


#5

The current config looks like this:

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/ }
        default_backend octoprint

and if i change it to this:

frontend public
        bind :::6000 v4v6
        bind :::6001 v4v6 ssl crt /etc/ssl/snakeoil.pem
        option forwardfor except 127.0.0.1
        use_backend webcam if { path_beg /webcam/ }
        default_backend octoprint

it dosnt work anymore


#6

What does "doesn't work" mean?


#7

i cant acess the interface anymore and it dosnt mater what port i use


#8

Attention with the choosen port!
Some browsers (e.g. Firefox) are blocking ports that are "normaly not used for internet activity"
Auswahl_239


#9


#10

Yea, that's the same behavior: "ERR_UNSAFE_PORT"
Try it with a port in the 5xxx (5001 works fine for me).


#11

Now i have set it to 5000 for http and 5001 for https and it says
" 400 Bad request
Your browser sent an invalid request."


#12

5000 cannot work because this port is bind to the backend at localhost (127.0.0.1),
as I said 5001 should work fine for the public frontend


#13

it works now thanks :slight_smile: