Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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