Files
greptweet/nginx.conf
2015-10-02 14:33:55 +08:00

50 lines
920 B
Nginx Configuration File

daemon off;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
sendfile on;
gzip on;
gzip_vary on;
gzip_types application/x-javascript text/css application/javascript application/json;
server {
listen 80;
server_name greptweet.com;
root /srv/http;
charset utf-8;
access_log /srv/http/u/greptweet.access.log;
error_log /srv/http/u/greptweet.error.log;
error_page 404 403 =303 /404.php;
location / {
index index.php index.html;
rewrite ^/f/(.*)$ /create.php?id=$1 last;
}
location ~ \.(txt)$ {
add_header Content-Encoding gzip;
gzip off;
}
location ~* \.(svg|css|js)$ {
expires 7d;
}
location ~* \.(appcache)$ {
expires 30s;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
}