From 3a2f43e8d5c85a116845c360902f268fd2798ffa Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 5 Mar 2014 16:56:45 -0500 Subject: add (untested) php and htaccess --- nginx.inc.conf | 13 ++----------- www/.htaccess | 25 +++++++++++++++++++++++++ www/index.php | 3 +++ www/js/api.js | 17 +++++++++++++---- www/warn.html | 2 +- www/warned.html | 1 + www/warned.php | 2 ++ 7 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 www/.htaccess create mode 100644 www/index.php create mode 100644 www/warned.php diff --git a/nginx.inc.conf b/nginx.inc.conf index 5b1cac7..890a674 100644 --- a/nginx.inc.conf +++ b/nginx.inc.conf @@ -11,7 +11,7 @@ location ~ ^/(css/font|js/lib)/ { expires 1d; } -location ~ ^/(index\.html)?$ { +location ~ ^/(index\.(html|php))?$ { set $warned NO; if ($http_cookie ~ "warned") { set $warned YES; @@ -24,19 +24,10 @@ location ~ ^/(index\.html)?$ { } } -location /warned.ngx { - add_header Set-Cookie "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly"; +location /warned.php { return 301 "/warned.html?$args&language=$http_accept_language"; } -location /warn.html { - break; -} - -location /robots.txt { - break; -} - expires 5s; add_header Cache-Control public; add_header X-UA-Compatible "IE=edge,chrome=1"; diff --git a/www/.htaccess b/www/.htaccess new file mode 100644 index 0000000..b51816a --- /dev/null +++ b/www/.htaccess @@ -0,0 +1,25 @@ + + ExpiresActive on + ExpiresDefault "access plus 1 minutes" + + ExpiresDefault "access plus 1 years" + + Header set X-Content-Duration "0" + + + + + + RewriteEngine On + RewriteCond %{HTTP:Accept-Encoding} gzip + RewriteCond %{REQUEST_FILENAME}\.gz -s + RewriteRule ^(.*)\.json $1\.json\.gz [QSA] + +# Prevent double gzip and give the correct mime-type + RewriteRule \.json\.gz$ - [T=application/json,E=no-gzip:1,E=FORCE_GZIP] + + Header set Content-Encoding gzip env=FORCE_GZIP + + +Header set Cache-Control "public" +Header set X-UA-Compatible "IE=edge,chrome=1" diff --git a/www/index.php b/www/index.php new file mode 100644 index 0000000..49fbbec --- /dev/null +++ b/www/index.php @@ -0,0 +1,3 @@ +https://bugzilla.happinessforme.com/, or use the official distribution until HTML5KS is feature-complete.

FYI, this site sets a single anonymous cookie (warned=1) so that you won't have to keep seeing this page. It also sets localStorage to keep your settings and saves. The latter always stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.

-
+


diff --git a/www/warned.html b/www/warned.html index 5d44d7c..99779ed 100644 --- a/www/warned.html +++ b/www/warned.html @@ -1,6 +1,7 @@