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

add DRUPAL_CORS variable #334

Closed

Conversation

noahwsmith
Copy link
Contributor

Addresses #333

The goal here is to add a .env variable that will allow setting a CORS value for Drupal without bindmounting the drupal.fpm.conf.tmpl file.

@joecorall
Copy link
Contributor

@noahwsmith - is this needed for static assets? Or can https://www.drupal.org/node/2715637 be used?

@noahwsmith
Copy link
Contributor Author

Hi Joe- I tested that and it turned out it worked well. I'll close out this Issue and PR.

We had previously had issues with multiple domains, but the current cors service syntax now allows what we need. For posterity, here is a working config that folks can adopt if they find this issue and have a similar need:

parameters:
  cors.config:
    enabled: true
    # Configure requests allowed from specific origins by commenting this out. All domains by uncommenting.
    #allowedOrigins: ['*']
    # Configure requests allowed from multiple origins matching against regex patterns.
    # You shouldn't allow "*" above if you're using Patterns also. Example patterns:
    allowedOriginsPatterns: ['/(.*\.traefik\.me|.*\.sitedomain\.edu|mirador.*\.netlify\.app)/']

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

Successfully merging this pull request may close these issues.

2 participants