diff --git a/greptweet.service b/greptweet.service index 1b92f7a..8f73033 100644 --- a/greptweet.service +++ b/greptweet.service @@ -1,6 +1,8 @@ [Unit] # https://docs.docker.com/articles/host_integration/ # https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/ +# /etc/systemd/system/greptweet.service +# sudo systemctl enable greptweet.service Description=Greptweet After=docker.service Requires=docker.service diff --git a/nginx.conf b/nginx.conf index 9eafbce..a6ef302 100644 --- a/nginx.conf +++ b/nginx.conf @@ -27,10 +27,14 @@ http { rewrite ^/f/(.*)$ /create.php?id=$1 last; } - location ~ \.(txt)$ { - add_header Content-Encoding gzip; - gzip off; - } + location ~ \.(gz)$ { + add_header Content-Encoding gzip; + gzip off; + } + + location ~ \.(txt)$ { + rewrite ^/u/(.*)/ /u/$1/$1.txt.gz last; + } location ~* \.(svg|css|js)$ { expires 7d;