summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-07-27 14:47:45 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-07-27 14:54:08 -0400
commitc27f033f4d794e28f4a6939df87ba54336127af0 (patch)
treed8f389d9db7645c9ea25ff70117f1a7d263d6c4a
parent4db774c1ec0c0b20611fea938d2603e6a3dfe4ca (diff)
downloadhtml5ks-c27f033f4d794e28f4a6939df87ba54336127af0.tar.xz
html5ks-c27f033f4d794e28f4a6939df87ba54336127af0.zip
use gzip_static only if nginx supports it
-rw-r--r--.gitignore4
-rw-r--r--nginx.conf2
-rwxr-xr-xnginx.sh7
3 files changed, 11 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 5119d23..902d0ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,10 @@
+# unrpyc built code
/unrpyc/renpy
+/unrpyc/*.json.o
/unrpyc/*.json
/unrpyc/*.rpyc
+# generated nginx conf
+/nginx.gen.conf
# ignore 'copyrighted' contents similar to emulators
/www/scripts
/www/dump
diff --git a/nginx.conf b/nginx.conf
index db84ed0..9e94114 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -36,7 +36,7 @@ http {
default_type application/octet-stream;
gzip on;
- gzip_static on;
+ include nginx.gen.conf;
gzip_types text/plain text/css application/javascript application/json;
gzip_vary on;
diff --git a/nginx.sh b/nginx.sh
index 998265e..c01b602 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -1,2 +1,7 @@
#!/bin/sh
-exec nginx -p `dirname $0` -c nginx.conf
+cd "`dirname $0`"
+touch nginx.gen.conf
+if nginx -V 2>&1 | grep -q -- --with-http_gzip_static_module; then
+ echo "gzip_static on" >> nginx.gen.conf
+fi
+exec nginx -p "$PWD" -c nginx.conf