upstream test1{
server 192.168.1.213;
server 192.168.1.37;
}
server {
listen 80; # default backlog=2048;

# listen 443 default ssl;
# ssl on;

# ssl_certificate ./ssl2/server.crt;
# ssl_certificate_key ./ssl2/server.key;
server_name www.nginx2.com ;
# server_name www.ghj.com;
#charset koi8-r;

#access_log logs/host.access.log main;

location / {
# proxy_redirect off;
# proxy_pass https://www.taobao.com;
# root /var/www/html;
# index index.html index.htm index.php;

#转发头中包含ip和代理ip
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#不使用缓存
proxy_buffering off;
proxy_pass http://test1;
}

相关文章:

  • 2022-01-07
  • 2021-06-03
猜你喜欢
  • 2021-05-23
  • 2021-07-14
  • 2021-11-19
  • 2021-10-04
  • 2021-10-05
  • 2021-11-10
相关资源
相似解决方案