-
Notifications
You must be signed in to change notification settings - Fork 0
/
colouri.se.nginx
85 lines (64 loc) · 1.96 KB
/
colouri.se.nginx
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This is the configuration file for http://colouri.se/
# Evidently, this server is running nginx with the native XSLT processor.
server {
listen [::]:80;
server_name colouri.se;
access_log /var/log/nginx/colouri.se.access.log;
xslt_types application/xhtml+xml;
root /srv/http/colouri.se;
if ($request_uri ~ ^/x?html/ )
{
rewrite ^/x?html/(.*)$ /$1 permanent;
}
location / {
add_header Vary Accept;
if ($uri ~ ^/\.git)
{
break;
}
rewrite ^/$ /hsl:0:1:1/2.10 redirect;
# Google+ seems to choke on XHTML
if ($http_user_agent ~* Google)
{
rewrite ^(.*)$ /html$1 last;
}
if ($http_accept ~* application/xhtml\+xml)
{
rewrite ^(.*)$ /xhtml$1 last;
}
rewrite ^(.*)$ /html$1 last;
}
location /.git {
error_page 403 /source-code;
}
location /css {
try_files $uri.css $uri =404;
}
location /js {
try_files $uri.js $uri =404;
}
location /xhtml {
alias /srv/http/colouri.se;
try_files $uri.xml $uri.xhtml /generated$uri;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-style-colouri.se.xslt;
}
location /html {
alias /srv/http/colouri.se;
try_files $uri.xml $uri.xhtml /generated$uri;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-style-colouri.se.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/html-post-process.xslt;
}
location /generated/xhtml {
proxy_pass http://unix:/var/tmp/colourise.socket:;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-style-colouri.se.xslt;
}
location /generated/html {
proxy_pass http://unix:/var/tmp/colourise.socket:;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/xhtml-style-colouri.se.xslt;
xslt_stylesheet /srv/http/colouri.se/xslt/html-post-process.xslt;
}
}