1. /usr/local/tengine/conf/conf.d
[root@slave1 conf.d]# cat myserver.conf
server {
listen 80;
client_max_body_size 4G;
server_name example.com 129.211.117.78 www.example.com;
keepalive_timeout 5;
access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/errors.log warn;
location / {
proxy_pass http://app_server1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
}
location /media {
alias /opt/sudjango/nginxdjango/media;
}
location /static {
alias /opt/sudjango/nginxdjango/static;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /path/to/app/current/public;
}
}
[root@slave1 conf.d]#
2. upstream.conf
[root@slave1 conf.d]# cat wltupstream.conf
upstream app_server1 {
server 10.0.0.11:8000 ;
sticky;
}
[root@slave1 conf.d]#
用一个例子来演示会更加清晰