#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream nginx.legendshop.com {
server localhost:8080;
server localhost:8082;
}
include mime.types;
default_type application/octet-stream;
client_header_buffer_size 64k;
large_client_header_buffers 4 64k;
proxy_buffer_size 4k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
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;
#tcp_nopush on;
proxy_ignore_client_abort on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
###禁止通过ip访问站点
server{
server_name _;
return 404;
access_log off;
}
server {
listen 82;
server_name localhost;
index index.html index.htm index.jsp;#设定访问的默认首页地址
#charset utf-8;
access_log logs/legend.access.log main;
location / {
root html;
proxy_pass http://nginx.legendshop.com;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}