Skip to content

Commit

Permalink
Update apache config for TM
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Nov 2, 2023
1 parent 4829c94 commit e6a603d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions images/web/config/production.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<Location />
CGIPassAuth Off
# For TM, do not use cgimap auth.
<If "%{HTTP_REFERER} !~ m#https://tasks(-\w+)?\.openhistoricalmap\.org/#">
CGIPassAuth On
</If>
</Location>

# ======Proxying traffic to CGImap====
Expand All @@ -32,7 +35,11 @@
RewriteRule ^/api/0\.6/node/[0-9]+/ways(\.json|\.xml)?$ fcgi://127.0.0.1:8000$0 [P]
RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full(\.json|\.xml)?$ fcgi://127.0.0.1:8000$0 [P]
RewriteRule ^/api/0\.6/(nodes|ways|relations)(\.json|\.xml)?$ fcgi://127.0.0.1:8000$0 [P]
# RewriteRule ^/api/0\.6/changeset/[0-9]+/(upload|download)(\.json|\.xml)?$ fcgi://127.0.0.1:8000$0 [P]

# For changeset requests originating from TM, do not use cgimap.
RewriteCond %{REQUEST_METHOD} ^POST$
RewriteCond %{HTTP_REFERER} !^https://tasks(-\w+)?\.openhistoricalmap\.org/ [NC]
RewriteRule ^/api/0\.6/changeset/[0-9]+/(upload|download)(\.json|\.xml)?$ fcgi://127.0.0.1:8000$0 [P]

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

0 comments on commit e6a603d

Please sign in to comment.