After the automatic start of OctoPrint configuration
at this point we can set up the system to answer to the standard port of an Http server.
For this purpose we install and configure the HAProxy reverse proxy
Proceed to the installation
1 |
sudo apt-get install haproxy |
Edit the /etc/haproxy/haproxy.cfg file and add to the default the directives including also the use of webcam
1 2 3 4 5 6 7 8 9 10 11 12 13 |
frontend public bind :::80 v4v6 use_backend webcam if { path_beg /webcam/ } default_backend octoprint backend octoprint reqrep ^([^\ :]*)\ /(.*) \1\ /\2 option forwardfor server octoprint1 127.0.0.1:5000 backend webcam reqrep ^([^\ :]*)\ /webcam/(.*) \1\ /\2 server webcam1 127.0.0.1:8080 |
Restart the proxy with the command
1 |
sudo systemctl restart haproxy |
Restart the Orange PI. If everything is configured correctly, the 3D print server answers on port 80 of the Orange Pi PC ip address
http://ORANGEPIPC_IP
It is possible to map the Octoprint service on port 5000 only to the loopback interface by editing the file ~/.octoprint/config.yaml
1 |
nano ~/.octoprint/config.yaml |
and adding the host reference under the server directive
1 2 |
server: host: 127.0.0.1 |
Restart OctoPrint
1 |
sudo systemctl restart octoprint |
Now the 5000 port is mapped only with the address 127.0.0.1.
In the next article, we’ll configure Linux to publish the hostname on the network so that it can be accessed through this reference without using the IP address