Nginx如何配置反向代理

server {
    listen 80;
    server_name 代理域名;

    location / {
        proxy_pass 应用域名:应用端口;
        proxy_set_header Host $host;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_redirect off;
        proxy_connect_timeout 60;
        proxy_read_timeout 600;
        proxy_send_timeout 600;
    }
}

  

posted on 2018-05-17 10:20  果然朝辉  阅读(185)  评论(0编辑  收藏  举报

导航