-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
71 lines (57 loc) · 2.27 KB
/
nginx.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
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
# rawgit
map $request_uri $detect_proxy_url_prefix {
~*^/images/galleries https://media.githubusercontent.com/media/ElixirRuhr/elixir.ruhr;
default https://raw.githubusercontent.com/ElixirRuhr/elixir.ruhr;
}
# file extension to mime-type mapping
# kind of workaround because nginx can detect mime-type only for local file
map $extension $detect_content_type {
~*^xml|xsl|xsd$ application/xml;
~*^atom$ application/atom+xml;
~*^xhtml|xht$ application/xhtml+xml;
~*^xslt$ application/xslt+xml;
~*^rss$ application/rss+xml;
~*^ttl$ text/turtle;
~*^vtt$ text/vtt;
~*^csv$ text/csv;
~*^n3$ text/n3;
~*^nt$ application/n-triples;
~*^rdf|owl$ application/rdf+xml;
~*^s?html?$ text/html;
~*^htc$ text/x-component;
~*^manifest|appcache$ text/cache-manifest;
~*^css$ text/css;
~*^js$ application/javascript;
~*^json$ application/json;
~*^jsonld$ application/ld+json;
~*^geojson$ application/vnd.geo+json;
~*^coffee$ text/x-coffeescript;
~*^hbs|handlebars$ text/x-handlebars-template;
~*^vcf|vcard$ text/vcard;
~*^md|markdown$ text/x-markdown;
~*^yml|yaml$ text/yaml;
~*^woff$ application/font-woff;
~*^woff2$ application/font-woff2;
~*^eot$ application/vnd.ms-fontobject;
~*^otf$ application/x-font-otf;
~*^ttc$ application/octet-stream;
~*^svg$ image/svg+xml;
~*^pdf$ application/pdf;
~*^swf$ application/x-shockwave-flash;
~*^kml$ application/vnd.google-earth.kml+xml;
default '';
}
# defines which extensions should include charset definition
map $extension $content_type_charset_string {
~*^woff2?|eot|otf|ttc|svg|pdf|swf|kml$ '';
default '; charset=utf-8';
}
map $http_referer $referer_domain {
~^https?://(?<domain>[^/]+) $domain;
}
root rawgit;
server {
listen 80;
server_name ~^(?<git_sha>.*?)\.preview.;
include rawgit/proxy.conf;
}