Nginx 配置代理服务器

修改配置nginx.conf

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include         mime.types;
    default_type    application/octet-stream;

    sendfile        on;
    keepalive_timeout       65;
    client_max_body_size    8M;
    client_body_buffer_size 128k;


    # dns
    resolver  8.8.8.8;

    server {
       listen 8888;
       location / {
           proxy_pass http://$http_host$request_uri;
       }
    }
}

其中 resolver 8.8.8.8; 使用的是谷歌dns,必要时需要替换。

在客户端设定Nginx服务器IP和上述的端口8888,即可通过改代理服务器连接网络。

发布了420 篇原创文章 · 获赞 143 · 访问量 89万+

猜你喜欢

转载自blog.csdn.net/jeikerxiao/article/details/100576470