Skip to content

Instantly share code, notes, and snippets.

@JokerQyou
Created July 7, 2013 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JokerQyou/5943622 to your computer and use it in GitHub Desktop.
Save JokerQyou/5943622 to your computer and use it in GitHub Desktop.
Nginx configuration for my selfoss site
#涉及到真实的服务器地址一律以 myselfoss.com 代替
server {
listen 80;
server_name myselfoss.com;
index index.php index.html index.htm;
root /home/wwwroot/rss;
error_log /var/log/nginx/rss.error.log;
access_log off;
location ~ \.php$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
#include fcgi.conf;
}
location ~* \ (gif|jpg|png) {
expires 30d;
}
location ~ ^/favicons/.*$ {
try_files $uri /data/$uri;
}
location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) {
deny all;
}
location / {
index index.php index.html index.htm;
try_files $uri /public/$uri /index.php$is_args$args;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment