reverse_proxy_multiple_octoprint_instances_with_nginx
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| reverse_proxy_multiple_octoprint_instances_with_nginx [2025/11/30 21:04] – tkbletsc | reverse_proxy_multiple_octoprint_instances_with_nginx [2025/11/30 21:14] (current) – tkbletsc | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| rewrite ^ https:// | rewrite ^ https:// | ||
| } | } | ||
| + | # require login | ||
| auth_basic | auth_basic | ||
| auth_basic_user_file / | auth_basic_user_file / | ||
| + | | ||
| + | # proxy | ||
| rewrite ^/ | rewrite ^/ | ||
| proxy_pass http:// | proxy_pass http:// | ||
| Line 33: | Line 36: | ||
| location / | location / | ||
| - | auth_basic off; | + | auth_basic off; # no login for just the webcam |
| rewrite ^/ | rewrite ^/ | ||
| proxy_pass http:// | proxy_pass http:// | ||
| Line 49: | Line 52: | ||
| rewrite ^ https:// | rewrite ^ https:// | ||
| } | } | ||
| + | # require login | ||
| auth_basic | auth_basic | ||
| auth_basic_user_file / | auth_basic_user_file / | ||
| + | | ||
| + | # proxy | ||
| rewrite ^/ | rewrite ^/ | ||
| proxy_pass http:// | proxy_pass http:// | ||
| Line 65: | Line 71: | ||
| location / | location / | ||
| - | auth_basic off; | + | auth_basic off; # no login for just the webcam |
| rewrite ^/ | rewrite ^/ | ||
| proxy_pass http:// | proxy_pass http:// | ||
| Line 73: | Line 79: | ||
| </ | </ | ||
| + | |||
| + | Then '' | ||
| Things to note: | Things to note: | ||
| - | * Octoprint (as configured in an Octopi install) expects the webcam to be at /webcam – an absolute URL. | + | |
| - | * Thus, the first " | + | |
| - | * Because // | + | * Thus, the first " |
| - | * The second Octoprint will map /webcam2 instead of just /webcam; we'll change the config on that instance as well to allow this | + | * Because // |
| - | * (Note: if you have just once octoprint instance, then you can skip the following steps, and you should be done) | + | * The second Octoprint will map /webcam2 instead of just /webcam; we'll change the config on that instance as well to allow this |
| + | * (Note: if you have just once octoprint instance, then you can skip the following steps, and you should be done) | ||
| + | * Auth stuff: | ||
| + | * The above config requires HTTP auth for the main interface, but explicitly allows the webcam without auth. | ||
| + | * This way you can stream the webcams from a plain page to anyone, but login requires auth. | ||
| + | * You can omit " | ||
| + | * You can omit all the " | ||
| ===== Enabling webcam support for Octoprint instances after the first ===== | ===== Enabling webcam support for Octoprint instances after the first ===== | ||
| Line 86: | Line 100: | ||
| We want to tweak each octoprint instances after the first as follows to give it a unique absolute URL to the webcam. This assumes Octoprint is installed as in Octopi. | We want to tweak each octoprint instances after the first as follows to give it a unique absolute URL to the webcam. This assumes Octoprint is installed as in Octopi. | ||
| - | Edit ''/ | + | Edit ''/ |
| < | < | ||
| Line 99: | Line 113: | ||
| </ | </ | ||
| + | Then '' | ||
| + | |||
| + | Then, in Octoprint web UI, go to configuration, | ||
| + | When done, the full UI including webcam should function both via direct connection to each Octoprint instance as well as via the URLs on the nginx proxy. | ||
reverse_proxy_multiple_octoprint_instances_with_nginx.1764565441.txt.gz · Last modified: by tkbletsc
