From 066e0bcf5c3009ae6741de02ce52bee4da565724 Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Fri, 11 Jul 2014 14:44:45 +0800 Subject: [PATCH] Our nginx configuration --- nginx.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..00598f4 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,37 @@ +# sudo systemctl start php-fpm +# sudo systemctl start nginx +# Tested with Nginx 1.6 on Archlinux + +events { + worker_connections 1024; +} + +http { + include mime.types; + sendfile on; + + server { + server_name greptweet; + root /srv/www/greptweet; + charset utf-8; + access_log /var/log/nginx/greptweet.access.log; + error_log /var/log/nginx/greptweet.error.log; + + location / { + index index.php index.html; + rewrite ^/f/(.*)$ /create.php?id=$1 last; + } + + location ~ \.txt$ { + gzip_static always; + gunzip on; + } + + location ~ \.php$ { + try_files $uri = 404; + fastcgi_pass unix:/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + include fastcgi.conf; + } + } +}