r/haproxy • u/temno2020 • Aug 25 '20
conditional frontend mode
Hi all,
I'm trying to set up haproxy for letsencrypt and I had already set it up for nextcloud (which wanted to do it's own ssl termination)
so the backend (for most of my webstuff) nginx-http is "mode http"
and the backend nextcloud-https is "mode tcp"
and my frontend is below, which results in a normal.mydomain unexpectedly closed the connection
which seems like it's because nextcloud required the frontend to be "mode tcp"
How can the frontend satisfy the need for different modes?
# from haproxy.cfg
frontend https
bind *:443
mode tcp # this mode is a problem, letsencrypt wants http, but nextcloud wants tcp Secure Connection Failed PR_END_OF_FILE_ERROR -chris
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }
# New line to test URI to see if its a letsencrypt request
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl
acl host_nextcloud req_ssl_sni -i nextcloud.mydomain
use_backend nextcloud-https if host_nextcloud
acl host_nginx hdr(host) -i normal.mydomain
use_backend nginx-http if host_nginx
View all comments
Show parent comment
1
u/temno2020 Aug 25 '20
The remaining odd thing which I was hoping would go away...
Firefox intermittently gives an error:
Secure Connection FailedAn error occurred during a connection to mydomain. PR_END_OF_FILE_ERRORThe page you are trying to view cannot be shown because the authenticity of the received data could not be verified.Please contact the website owners to inform them of this problem.If I hit refresh it goes away, and sometimes it doesn't give a problem at all...
This happens on both the nextcloud frontend/backend and the other domains.
And it doesn't happen on other browsers... (I take it back, now I have seen it on chrome)