nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
stream {
include module/stream/*.conf;
}
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" ';
log_format main2 '[$time_local]'
' $remote_addr $http_x_forwarded_for $remote_user $http_referer $http_user_agent'
' "$request" $status $body_bytes_sent $bytes_sent $request_length'
' [$request_time]--[$upstream_response_time]';
log_format testLog '$remote_addr [$time_local]'
'$http_host | $Host|$proxy_host'
' $proxy_port| $server_port';
open_log_file_cache max=1000 inactive=60s;
sendfile on;
keepalive_timeout 60s;
keepalive_requests 8192;
include module/httpsvr/*.conf;
}
rtmp {
include module/rtmpsvr/*.conf;
}
conf\module\ex
location_http.conf
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Via "nginx";
proxy_cache_bypass $cookie_nocache $arg_nocache $arg_comment;
proxy_cache_bypass $http_pragma $http_authorization;
proxy_no_cache $cookie_nocache $arg_nocache $arg_comment;
proxy_no_cache $http_pragma $http_authorization;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
location_https.conf
proxy_redirect http:// https://;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Via "nginx";
proxy_cache_bypass $cookie_nocache $arg_nocache $arg_comment;
proxy_cache_bypass $http_pragma $http_authorization;
proxy_no_cache $cookie_nocache $arg_nocache $arg_comment;
proxy_no_cache $http_pragma $http_authorization;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
httpsvr
upserver.conf
upstream abc.com{
server 127.0.0.1:9666 weight=5 max_fails=2 fail_timeout=30s max_conns=3