Skip to content

Commit

Permalink
Update apache rules for CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Sep 11, 2023
1 parent 1d23f75 commit 2920cdd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions images/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ RUN apt-get update && apt-get install -y libapache2-mod-passenger lighttpd
# Enable the Passenger Apache module and restart Apache
RUN echo "ServerName $(cat /etc/hostname)" >> /etc/apache2/apache2.conf
RUN a2enmod passenger
RUN a2enmod headers
RUN a2enmod setenvif

# Check installation
RUN /usr/bin/passenger-config validate-install
Expand Down
7 changes: 7 additions & 0 deletions images/web/config/production.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)$
RewriteRule ^0\.6/(node|way|relation)/([^/]+)$ - [L,H=fcgi:127.0.0.1:80]

# Conditionally set CORS headers for openhistoricalmap.org subdomains
SetEnvIf Origin "https://(.*\.)?openhistoricalmap\.org$" AccessControlAllowOrigin=$0
Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS" env=AccessControlAllowOrigin
Header set Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" env=AccessControlAllowOrigin
Header set Access-Control-Expose-Headers "Content-Length,Content-Range" env=AccessControlAllowOrigin

# Relax Apache security settings
<Directory /var/www/public>
AllowOverride None
Expand Down
4 changes: 2 additions & 2 deletions values.staging.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ osm-seed:
# Variables for changeset-replication-job, Configuration to create the replication files by, minute, hour, or day
# ====================================================================================================
osmchaWeb:
enabled: true
enabled: false
env:
DJANGO_CACHES: "{'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211'}}"
DJANGO_DEBUG: "False"
Expand Down Expand Up @@ -742,7 +742,7 @@ osm-seed:
# Variables for changeset-replication-job, Configuration to create the replication files by, minute, hour, or day
# ====================================================================================================
osmchaDb:
enabled: true
enabled: false
env:
POSTGRES_DB: {{STAGING_OSMCHA_PG_DATABASE}}
POSTGRES_USER: {{STAGING_OSMCHA_PG_USER}}
Expand Down

0 comments on commit 2920cdd

Please sign in to comment.