19,620
社区成员




# server configure
server_tokens off;
include mime.types;
default_type application/octet-stream;
#proxy_cache_path /usr/local/nginx/cache levels=1:2:2 keys_zone=cache_one:10m inactive=30m max_size=500m;
#proxy_cache_valid 200 302 10m;
#proxy_cache_valid 404 1m;
proxy_temp_path /usr/local/nginx/proxy_temp_dir;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 10;
client_header_timeout 10;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 10;
gzip on;
gzip_disable "msie6";
gzip_proxied any;
gzip_min_length 1000;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
open_file_cache max=100000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
#upstream testWeb{
# server 192.168.100.197:9080 max_fails=3 fail_timeout=30s;
#}
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
server {
listen 80;
server_name localhost;
location / {
#rewrite (.*) http://192.168.100.196/demo1;
proxy_pass http://192.168.100.197:9080/demo1;
}
location /demo1 {
proxy_pass http://192.168.100.197:9080/demo1;
}
}