Our nginx configuration

This commit is contained in:
Kai Hendry
2014-07-11 14:44:45 +08:00
parent 00d95cdc9e
commit 066e0bcf5c

37
nginx.conf Normal file
View File

@@ -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;
}
}
}