Nginx虚拟主机配置

来源:互联网 发布:如何下载linux mint 编辑:程序博客网 时间:2024/06/08 08:37

以www.youraccount.me项目为例

server {

    charset utf-8;
    client_max_body_size 128M;


    listen 80;
    server_name www.youraccount.me;
    root        /home/wwwroot/youraccount/advanced/frontend/web;
    #root       /home/wwwroot/;
    index       index.php;




    location / {
            if (!-e $request_filename){
                    rewrite ^(.*)$ /index.php;
            }
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            fastcgi_param RUN_MODE 'production';
    }


    location ~ /\.(ht|svn|git) {
        deny all;
    }
    location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css|woff|woff2)$
    {


    }
    access_log  /home/wwwlogs/access_inter.com.log;
    error_log   /home/wwwlogs/error_inter.com.log debug;
}
原创粉丝点击