Skip to content
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

Allow multiple origins #79

Closed
SaFrMo opened this issue Jan 22, 2020 · 3 comments
Closed

Allow multiple origins #79

SaFrMo opened this issue Jan 22, 2020 · 3 comments

Comments

@SaFrMo
Copy link

SaFrMo commented Jan 22, 2020

Hello! Thanks so much for the work on the project, it's extremely helpful to have an open-source self-hosted analytics solution like this.

I'm working on a project where I'd like to track multiple origins with a single Heroku Ackee server. I have config vars set and working:

ACKEE_ALLOW_ORIGIN=https://example.com

But I'd also like to track from a subdomain of this origin:

ACKEE_ALLOW_ORIGIN=https://subdomain.example.com

Either of these configs work on their own, but I can't add both with a comma or wildcard:

// doesn't work
ACKEE_ALLOW_ORIGIN=https://example.com,https://subdomain.example.com

// doesn't work
ACKEE_ALLOW_ORIGIN=https://*.example.com

Is there any config-var-only solution I'm missing here, or is this feature not available? Thanks again for your time!

@electerious
Copy link
Owner

ACKEE_ALLOW_ORIGIN sets the Access-Control-Allow-Origin header. The header only allows a wildcard * or a single domain. You can avoid this issue by using a reverse proxy (like nginx): https://github.com/electerious/Ackee/blob/master/docs/SSL%20and%20HTTPS.md#advanced-configuration

But I agree that it would make sense to update our option to include some server logic that checks the referrer and adds the correct origin for a list of origins. Or none if there's no matching domain.

@SaFrMo
Copy link
Author

SaFrMo commented Jan 22, 2020

Got it, that makes sense! In my case the wildcard will be perfect.

The list of origins would be a useful feature but it also makes a lot of sense that ACKEE_ALLOW_ORIGIN translates directly to the Access-Control-Allow-Origin header.

Thank you!

@electerious
Copy link
Owner

The next version (v1.6.0) will support multiple domains thanks to @jaryl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants