配置Nginx正向代理示例

by Web全栈工程师 on 2012 年 01 月 11 日

文档:http://nginx.org/en/docs/http/ngx_http_proxy_module.html

server {
    listen 80;
    server_name domain;
    index index.php;

    location / {
        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;
        proxy_pass http://127.0.0.1:83;

        client_max_body_size 100m;
        client_body_buffer_size 128k;

        proxy_connect_timeout 5;
        proxy_read_timeout 60;
        proxy_send_timeout 5;

        proxy_buffer_size 4k;
        proxy_buffers 4 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;
        proxy_ignore_client_abort on;
    }

        access_log /var/log/nginx/domain.access.log;
        error_log /var/log/nginx/domain.error.log;

}

原创文章,转载请注明:转载自Web开发笔记 | 配置Nginx正向代理示例

本文链接地址:https://www.magentonotes.com/ngx_http_proxy_module.html

Comments on this entry are closed.

Previous post:

Next post: