user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 off;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
upstream mysvr_login {
server 127.0.0.1:2018;
server 127.0.0.1:2019;
server 127.0.0.1:2020;
server 127.0.0.1:2021;
}
server {
listen 2016;
server_name loginserver;
location / {
proxy_pass http://mysvr_login;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
upstream mysvr_world {
server 127.0.0.1:2025;
}
server {
listen 2017;
server_name worldserver;
location / {
proxy_pass http://mysvr_world;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
upstream mysvr_chat {
server 127.0.0.1:2035;
}
server {
listen 2014;
server_name chatserver;
location / {
proxy_pass http://mysvr_chat;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}