D
Dokploy4mo ago
Inf

Dokploy to HAProxy

Hello all! I'd like to explain my problem: I have a HAProxy at home because I have several servers that use 80/443. Has anyone been able to experiment with this or just tell me if it's possible to do it? And if it's possible, do you have an example of configuration or something because I haven't found anything on the doc I'd also like to be able to read visitors' IPs (on the header) and I use Cloudflare afterwards for my DNS Thank you very much.
2 Replies
𝗠𝗿𝟭𝗕𝗹𝗮𝘇𝗲
Can I see your configuration?
Inf
InfOP3mo ago
here is the basic configuration that i'm doing with my first vps:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon

defaults
log global
timeout connect 5000
timeout client 50000
timeout server 50000

frontend frontend_http
bind *:80
mode http
option httplog

use_backend client1_http if { hdr_end(host) -i docker.tld }
use_backend client2_http if { hdr_end(host) -i dokploy.tld }

frontend frontend_https
bind *:443
mode tcp
option tcplog
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }

use_backend client1_https if { req.ssl_sni -m end docker.tld }
use_backend client2_https if { req.ssl_sni -m end dokploy.tld }

backend client1_http
mode http
server client1_http 10.0.0.2:80 send-proxy-v2 check

backend client1_https
mode tcp
server client1_https 10.0.0.2:443 send-proxy-v2 check

backend client2_http
mode http
server client2_http 10.0.0.3:80 send-proxy-v2 check

backend client2_https
mode tcp
server client2_https 10.0.0.3:443 send-proxy-v2 check
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon

defaults
log global
timeout connect 5000
timeout client 50000
timeout server 50000

frontend frontend_http
bind *:80
mode http
option httplog

use_backend client1_http if { hdr_end(host) -i docker.tld }
use_backend client2_http if { hdr_end(host) -i dokploy.tld }

frontend frontend_https
bind *:443
mode tcp
option tcplog
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }

use_backend client1_https if { req.ssl_sni -m end docker.tld }
use_backend client2_https if { req.ssl_sni -m end dokploy.tld }

backend client1_http
mode http
server client1_http 10.0.0.2:80 send-proxy-v2 check

backend client1_https
mode tcp
server client1_https 10.0.0.2:443 send-proxy-v2 check

backend client2_http
mode http
server client2_http 10.0.0.3:80 send-proxy-v2 check

backend client2_https
mode tcp
server client2_https 10.0.0.3:443 send-proxy-v2 check
so it will be another domain I was thinking of using a full strict on Cloudflare and the Origin certificate because I need to be able to modify the headers just in case Up

Did you find this page helpful?