#user nobody; worker_processes 1; #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 { 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; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # nginx proxy upstream sina{ #配置代理连接的地址 server 192.168.25.129:8081; } server { # 默认监听80端口 listen 80; # 在这里配置域名 server_name www.sina.com; #charset koi8-r; #access_log logs/host.access.log main; location / { # 配置代理地址 proxy_pass http://sina; index index.html index.htm; } } upstream sohu{ server 192.168.25.129:8080; } server { listen 80; server_name www.souhu.com; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://sohu; index index.html index.htm; } } }