Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use in a load balanced scenario #8431

Closed
3 tasks done
nichols-green opened this issue Sep 29, 2021 · 0 comments
Closed
3 tasks done

Unable to use in a load balanced scenario #8431

nichols-green opened this issue Sep 29, 2021 · 0 comments

Comments

@nichols-green
Copy link
Contributor

Preflight Checklist

Describe the Bug

When used in a load balanced situation with two nodes and a load balancer, the public_url env var breaks the load balance config.

server 1 is addressed as mysite-1.mydomain.org
server 2 is addressed as mysite-2.mydomain.org
The LB is addressed as mysite.mydomain.org.

In the Directus config, I've set the public_url to mysite.mydomain.org. This works for the customer facing site and the email invitations. This setup fails when attempting to reach the -1, -2 sites directly. This is essential as the load balancer health check attempts to reach the downstream servers by their -1, -2 addresses.

Essentially we can run the site without health checks and everything works, or we can enable health checks as is our policy and the site breaks. The load balancer isn't able to get a response from the health check endpoints, and therefore has no active downstream servers to route to.

Lastly, I set the public_url variable to / and everything worked as expected. The load balancer health checks worked, and the site was reachable at all three addresses. I thought this was the solution, until I tried to invite a member of my team to the site and the links in the email were all just relative links prefixed with /

I would suggest separating thi public_url variable into public_url and host_url, or something along those lines to allow the use of / as the site host and still have mysite.mydomain.org in the email prefix and other areas where that would be used.

To Reproduce

Deploy a site to two or more servers, with a loadbalancer. Assign the servers addresses, and assign the loadbalancer an address. Set the public_url env var to the value of the load balancer address. Ensure health checks are off. The site should work as expected, but the two direct addresses will not work.

Set the public_url value to /, and the site should be working as expected. Invite someone to the site, and check the email links. The links will not be complete.

What version of Directus are you using?

9.0.0-rc76

What version of Node.js are you using?

14.15.3

What database are you using?

SqlServer

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying Directus?

On premise with IIS

@directus directus locked and limited conversation to collaborators Sep 29, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants