From 38a8dfe75f626958a3f49b05142e31cf946b1845 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 9 Jan 2014 16:15:01 -0500 Subject: Move general conf to nginx.inc.conf --- nginx.inc.conf | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 nginx.inc.conf (limited to 'nginx.inc.conf') diff --git a/nginx.inc.conf b/nginx.inc.conf new file mode 100644 index 0000000..b795a1c --- /dev/null +++ b/nginx.inc.conf @@ -0,0 +1,42 @@ +location /json/ { + expires 1y; +} + +location /dump/ { + expires 1y; + location ~ ^/dump/(bgm|sfx)/ { add_header X-Content-Duration "0"; } +} + +location ~ ^/(css/font|js/lib)/ { + expires 1d; +} + +location / { + set $warned NO; + if ($http_cookie ~ "warned") { + set $warned YES; + } + if ($args ~ "warned") { + set $warned YES; + } + if ($warned = NO) { + return 307 /warn.html; + } +} + +location /setcookie.html { + add_header Set-Cookie "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly"; + return 301 /; +} + +location /warn.html { + break; +} + +location /robots.txt { + break; +} + +expires 5s; +add_header Cache-Control public; +add_header X-UA-Compatible "IE=edge"; -- cgit v1.2.3-54-g00ecf