PHP的Nginx配置

0

server {
    listen      80;
    server_name bbs.acgist.com;
    root        /home/www/bbs;
    #charset    utf-8;
 
    access_log  /var/log/nginx/bbs.acgist.com.log  main;
 
    location ~* \.(mp3|mp4|gif|png|jpg|css|js)$ {
        expires         30d;
        add_header      Pragma  public;
        add_header      Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log      off;
        log_not_found   off;
        tcp_nodelay     off;
        root            /home/www/bbs;
        error_page      404 /resources/images/404.png;
    }
 
    location ~ \.php$ {
        root            /home/www/bbs;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }
 
    location / {
        index index.php;
        root  /home/www/bbs;
    }
 
}

之前搞的discuz的Nginx配置,记录一下。