forked from guysoft/OctoPi
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build will check which one is installed and only enable the correct one. See also guysoft#711
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
49 changes: 49 additions & 0 deletions
49
src/modules/octopi/filesystem/root/etc/haproxy/haproxy.2.x.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
global | ||
maxconn 4096 | ||
user haproxy | ||
group haproxy | ||
log /dev/log local1 debug | ||
tune.ssl.default-dh-param 2048 | ||
|
||
defaults | ||
log global | ||
mode http | ||
compression algo gzip | ||
option httplog | ||
option dontlognull | ||
retries 3 | ||
option redispatch | ||
option http-server-close | ||
option forwardfor | ||
maxconn 2000 | ||
timeout connect 5s | ||
timeout client 15min | ||
timeout server 15min | ||
|
||
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/ } | ||
use_backend webcam_hls if { path_beg /hls/ } | ||
use_backend webcam_hls if { path_beg /jpeg/ } | ||
default_backend octoprint | ||
|
||
backend octoprint | ||
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0 | ||
|
||
http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2 | ||
http-request add-header X-Scheme https if needs_scheme { ssl_fc } | ||
http-request add-header X-Scheme http if needs_scheme !{ ssl_fc } | ||
option forwardfor | ||
server octoprint1 127.0.0.1:5000 | ||
errorfile 503 /etc/haproxy/errors/503-no-octoprint.http | ||
|
||
backend webcam | ||
http-request replace-path /webcam/(.*) /\1 | ||
server webcam1 127.0.0.1:8080 | ||
errorfile 503 /etc/haproxy/errors/503-no-webcam.http | ||
|
||
backend webcam_hls | ||
server webcam_hls_1 127.0.0.1:28126 | ||
errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters