Skip to content

Commit

Permalink
Set CORS headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Sep 11, 2023
1 parent 2920cdd commit 3885da4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions images/web/config/production.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
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
# Set CORS headers
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header set Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"
Header set Access-Control-Expose-Headers "Content-Length,Content-Range"

# Relax Apache security settings
<Directory /var/www/public>
Expand Down

0 comments on commit 3885da4

Please sign in to comment.