-
Notifications
You must be signed in to change notification settings - Fork 14
/
reuse.software.conf
38 lines (30 loc) · 1011 Bytes
/
reuse.software.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# SPDX-FileCopyrightText: Free Software Foundation Europe e.V.
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Redirect www subdomain to non-www
<VirtualHost *:8080>
RewriteEngine On
# Get protocol
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ - [env=proto:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ - [env=proto:http]
# Rewrite to proto://www-less-host/location
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ %{ENV:proto}://%1$1 [R=301,L]
</VirtualHost>
<VirtualHost *:8080>
ServerName reuse.software
ServerAlias www.reuse.software
ServerAlias localhost
ServerAdmin [email protected]
DocumentRoot /app
<Directory /app/>
Options FollowSymLinks Includes
AllowOverride All
Require all granted
SetEnvIf Origin ^(https?://(?:.+\.)?reuse\.software(?::\d{1,5})?)$ CORS_ALLOW_ORIGIN=$1
Header append Access-Control-Allow-Origin %{CORS_ALLOW_ORIGIN}e env=CORS_ALLOW_ORIGIN
Header merge Vary "Origin"
</Directory>
</VirtualHost>