custom javascript handling
[via-proxy] / providers / www.artstor.org.conf
1 # ./add-provider.pl www.artstor.org library.artstor.org
2
3
4
5 <VirtualHost *:443>
6         Include /srv/via-proxy/ssl.conf
7
8         ServerName www.artstor.org.p.vbz.ffzg.hr
9
10         RewriteEngine on
11         # fix broken chunging
12         #RewriteRule    /common/javascript/extjs/ext-all.js     https://www.artstor.org/common/javascript/extjs/ext-all.js [R,L]
13
14         SSLProxyEngine on
15         ProxyAddHeaders Off
16         ProxyPass        / https://www.artstor.org/
17         ProxyPassReverse / https://www.artstor.org/
18
19         Header edit* Set-Cookie "(.*)(?i:; *domain=)([^;]+)(.*)" "$1 ; domain=$2.p.vbz.ffzg.hr $3"
20         #Header edit* Set-Cookie "(.*)(?i:; *secure)" "$1"
21 # if there are problems, remove traling /
22         Header edit* Location "https://www.artstor.org/" "https://www.artstor.org.p.vbz.ffzg.hr/"
23         Header edit* Location "https://library.artstor.org/" "https://library.artstor.org.p.vbz.ffzg.hr/"
24
25         RequestHeader unset Accept-Encoding
26         Substitute "s|https://www.artstor.org|https://www.artstor.org.p.vbz.ffzg.hr|"
27         Substitute "s|https://library.artstor.org|https://library.artstor.org.p.vbz.ffzg.hr|"
28
29         FilterDeclare NEWPATHS
30         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/html|"
31         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/css|"
32         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/javascript|"
33         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^application/javascript|"
34         FilterChain NEWPATHS
35
36         CustomLog /var/log/apache2/access-p.vbz.ffzg.hr.log vhost_combined
37 </VirtualHost>
38
39
40 <VirtualHost *:443>
41         Include /srv/via-proxy/ssl.conf
42
43         ServerName library.artstor.org.p.vbz.ffzg.hr
44
45         RewriteEngine on
46         # fix broken chunging
47         #RewriteRule    /common/javascript/extjs/ext-all.js     https://library.artstor.org/common/javascript/extjs/ext-all.js [R,L]
48
49         SSLProxyEngine on
50         ProxyAddHeaders Off
51         ProxyPass        / https://library.artstor.org/
52         ProxyPassReverse / https://library.artstor.org/
53
54         Header edit* Set-Cookie "(.*)(?i:; *domain=)([^;]+)(.*)" "$1 ; domain=$2.p.vbz.ffzg.hr $3"
55         #Header edit* Set-Cookie "(.*)(?i:; *secure)" "$1"
56 # if there are problems, remove traling /
57         Header edit* Location "https://www.artstor.org/" "https://www.artstor.org.p.vbz.ffzg.hr/"
58         Header edit* Location "https://library.artstor.org/" "https://library.artstor.org.p.vbz.ffzg.hr/"
59
60         RequestHeader unset Accept-Encoding
61         Substitute "s|https://www.artstor.org|https://www.artstor.org.p.vbz.ffzg.hr|"
62         Substitute "s|https://library.artstor.org|https://library.artstor.org.p.vbz.ffzg.hr|"
63
64         Substitute "s|/(\w+\.[0-9a-f]+.js)|https://library.artstor.org/$1|i"
65
66         FilterDeclare NEWPATHS
67         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/html|"
68         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/css|"
69         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/javascript|"
70         FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^application/javascript|"
71         FilterChain NEWPATHS
72
73         CustomLog /var/log/apache2/access-p.vbz.ffzg.hr.log vhost_combined
74 </VirtualHost>
75
76
77 ## add domains to SSL certificate:
78 # www.artstor.org.p.vbz.ffzg.hr
79 # library.artstor.org.p.vbz.ffzg.hr