天天看点

linux nginx虚拟主机配置文件内容

#

# The default server

#

server {

        listen   80;

        server_name  192.168.176.128;

        root   /html;

        index  index.html index.htm index.php;

        location ~ .*\.(php|php5)?$ {

                root   html;

                fastcgi_pass   127.0.0.1:9000;

                fastcgi_index  index.php;

                fastcgi_param  SCRIPT_FILENAME  /html$fastcgi_script_name;

                include fastcgi_params;

        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

                {expires  30d;}

                location ~ .*\.(js|css)?$

                {expires  1h;}

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '

                                '$status $body_bytes_sent "$http_referer" '

                                '"$http_user_agent" $http_x_forwarded_for';

                access_log  /var/log/access.log  access;

}