0. 一个Nginx静态资源Web服务器的配置文件示例:
worker_processes 1;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" ';
gzip on;
gzip_min_length 1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
server {
listen 127.0.0.1:8000;
server_name localhost;
access_log logs/host.access.log main;
location /test/ {
alias conf/;
autoindex on;
}
location / {
root html;
index index.html