您的位置:首页 > 运维架构 > Nginx

Nginx虚拟主机配置

2017-07-12 22:05 429 查看
以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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: