docusealco / docuseal

Open source DocuSign alternative. Create, fill, and sign digital documents ✍️
https://www.docuseal.co
GNU Affero General Public License v3.0
5.97k stars 410 forks source link

Docuseal SSL issue behind HAPROXY #86

Closed lucafolin closed 1 year ago

lucafolin commented 1 year ago

Hi, I'm running Docuseal docker container behind an HAPROXY only with these environmental variables:

the container is running fine and I can load the setup webpage. When I insert my data to setup Docuseal I receive this error:

image

In the log file I can see this error:

%I, [2023-08-10T10:45:06.784774 #1]  INFO -- : [eb048852-938c-4483-a19f-f64891a8aab0] {"method":"GET","path":"/","format":"html","controller":"DashboardController","action":"index","status":302,"duration":2.67,"view":0.0,"db":0.25,"location":"https://docuseal.mysite.com/setup","fwd":"192.168.2.1"}

I, [2023-08-10T10:45:06.903578 #1]  INFO -- : [e7dd72ab-9db1-41a2-b723-0458f928e1d8] {"method":"GET","path":"/setup","format":"html","controller":"SetupController","action":"index","status":200,"duration":11.78,"view":8.35,"db":0.24,"fwd":"192.168.2.1"}

W, [2023-08-10T10:45:13.738260 #1]  WARN -- : [da284d1f-9337-4910-a9b7-d1e23bf4f2d1] HTTP Origin header (https://docuseal.mysite.com) didn't match request.base_url (http://docuseal.mysite.com)

I, [2023-08-10T10:45:13.739229 #1]  INFO -- : [da284d1f-9337-4910-a9b7-d1e23bf4f2d1] {"method":"POST","path":"/setup","format":"turbo_stream","controller":"SetupController","action":"create","status":422,"duration":1.08,"view":0.0,"db":0.0,"fwd":"192.168.2.1"}

F, [2023-08-10T10:45:13.741258 #1] FATAL -- : [da284d1f-9337-4910-a9b7-d1e23bf4f2d1]                                                                                                                        [da284d1f-9337-4910-a9b7-d1e23bf4f2d1] ActionController::InvalidAuthenticityToken (HTTP Origin header (https://docuseal.mysite.com) didn't match request.base_url (http://docuseal.mysite.com)):

Do you have any suggestion to fix this issue that probably is related to the proxy setting to work with Docuseal ?

AlexandrToorchyn commented 1 year ago

@lucafolin Maybe this will help: Configuring DocuSeal Behind an Existing Reverse Proxy (nginx)

lucafolin commented 1 year ago

@AlexandrToorchyn thanks for sharing, yes this is my problem but I am not able to reproduce these header rules in HAProxy. I know this is not strictly related to Docuseal, but is it possible to deploy the same rules for HAProxy as well?

This is my HAProxy WAN frontend setting:

image

but it's not working. I still receive 422 error

lucafolin commented 1 year ago

ok I solved with these setting:

image

image2

thk

AlexandrToorchyn commented 1 year ago

@lucafolin I'm glad to hear that it's working now!