How to change the service port ASTROBOX


#21

noting things as I go. I learned that haproxy is used. This is proxying 80 to port 5000(octoprint) and 8085 (Webcam). When I change the public facing port 80 in this file I no longer get a response from the server…which is good because it proves this configuration file is a major playering in getting port forwarding to work.

Also in this haproxy.cfg file is the default page for 503 error “/etc/astrobox/errors/503.http”. This is the page we all received when we change the port in the yaml file. So, what we were all getting is really an HTTP 503 error that was being handled by the webserver in a friendly manner.

Still searching…will keep posting


#22

[SOLUTION]

Ok, it’s working. Here are the steps:
FYI…no need to touch the config.yaml file at all.

Step 1:
sudo nano /etc/haproxy/haproxy.cfg

Step 2:
Locate the below code
frontend public
bind *:80
use_backend webcam if { path_beg /webcam/ }
default_backend astrobox
errorfile 503 /etc/astrobox/errors/503.http

Change bind to whatever port you want
frontend public
bind *:3080
use_backend webcam if { path_beg /webcam/ }
default_backend astrobox
errorfile 503 /etc/astrobox/errors/503.http

Step 3:
sudo service haproxy restart

Step 4 (optional):
Go into your route firewall and redirect the port you entered to the astrbox’s IP.

That’s it. Hope this helps. Enjoy.