配置文件
user nobody nobody;
worker_processes 3;
events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
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"';
access_log logs/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_disable "MSIE [1-6].";
client_header_buffer_size 128k;
large_client_header_buffers 4 128k;
server {
listen 8081;
server_name 192.168.31.111;
root mallx/html;
access_log /opt/mallx/server1/log/access.log;
error_page 404 /404.html;
location /server1/location1 {
root /opt/mallx/server1;
index index1.server1.html index2.server1.html;
}
location /server1/location2 {
root /opt/mallx/server1;
index index1.server1.html index2.server1.html;
}
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
expires 30d;
}
location ~ /.ht {
deny all;
}
}
server {
listen 8082;
server_name 192.168.31.111;
access_log /opt/mallx/server2/log/access.log;
error_page 404 /404.html;
location /server2/location1 {
root /opt/mallx/server1;
index index1.server2.html index2.server2.html;
}
location /server2/location2 {
alias /codesheep/webserver/server2/location2/;
index index1.server2.html index2.server2.html;
}
location = /404.html {
root root /opt/mallx/;
index 404.html;
}
}
}