-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyn.chroni.se.nginx
122 lines (91 loc) · 3.1 KB
/
syn.chroni.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This is the configuration file for http://syn.chroni.se/
# Evidently, this server is running nginx with the native XSLT processor.
map $request_uri $clock {
~^(.*)/@(?<cl>clock).*$ $cl;
}
map $request_uri $clocktype {
~^(.*)/\w+,@(?<ty>analog)$ $ty;
}
server {
listen 80;
listen [::]:80;
keepalive_timeout 70;
server_name *.chroni.se;
server_name chroni.se;
return 301 http://syn.chroni.se$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name syn.chroni.se;
access_log /var/log/nginx/syn.chroni.se.access.log;
xslt_types application/xhtml+xml image/svg+xml;
root /srv/http/syn.chroni.se;
xslt_string_param clock $clock;
xslt_string_param clocktype $clocktype;
location / {
add_header Vary Accept;
if ($uri ~ ^/(\.git|robots|favicon))
{
break;
}
if ($http_accept ~* application/xhtml\+xml)
{
rewrite ^/$ /xhtml/now redirect;
rewrite ^(.*)$ /xhtml$1 redirect;
}
rewrite ^/$ /html/now redirect;
rewrite ^(.*)$ /html$1 redirect;
}
location /.git {
error_page 403 /~https://github.com/jyujin/syn.chroni.se;
}
location /css {
try_files $uri.css $uri =404;
}
location /js {
try_files $uri.js $uri =404;
}
location /svg {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.svg $uri /svg/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/js-disabled.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/svg-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/svg-style-syn.chroni.se.xslt;
}
location /svg+js {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.svg $uri /svg+js/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/js-enabled.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/svg-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/svg-style-syn.chroni.se.xslt;
}
location /xhtml {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.xhtml $uri /xhtml/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-style-syn.chroni.se.xslt;
}
location /xhtml+js {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.xhtml $uri /xhtml+js/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/js-enabled.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-style-syn.chroni.se.xslt;
}
location /html {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.xhtml $uri /html/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-style-syn.chroni.se.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/html-post-process.xslt;
}
location /html+js {
alias /srv/http/syn.chroni.se;
try_files $uri.xml $uri.xhtml $uri /html+js/generate;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/js-enabled.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-page.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/xhtml-style-syn.chroni.se.xslt;
xslt_stylesheet /srv/http/syn.chroni.se/xslt/html-post-process.xslt;
}
}