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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drupal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ additional settings, volumes, ports, etc.
| :----------------------- | :------ | :--------------------------------------------------------------------------------- |
| DRUPAL_ENABLE_HTTPS | true | Inform PHP that `https` should be used. |
| DRUPAL_REVERSE_PROXY_IPS | | Use the IP address for the host 'traefik' if found otherwise default to `0.0.0.0`. |
| DRUPAL_CORS | | Set a value for CORS: either <blank> (default), '*', or a single 'http://domain' |

### Database Settings

Expand Down
3 changes: 3 additions & 0 deletions drupal/rootfs/etc/confd/templates/drupal.fpm.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ location ~ '\.php$|^/update.php' {
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
{{ end }}
{{ if ne (getenv "DRUPAL_CORS") "" }}
add_header Access-Control-Allow-Origin '{{ getenv "DRUPAL_CORS" }}';
{{ end }}
fastcgi_intercept_errors on;
# Large Islandora repositories global searches end up with HUGE header sizes
fastcgi_buffers 16 800k;
Expand Down