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;、GoogleのDNSを使用している、必要に応じて交換する必要があります。

クライアントでNginxサーバーのIPとポート8888を設定して、プロキシサーバー経由でネットワークに接続します。

420件の元の記事を公開しました 143件のいいね 890,000回の閲覧

おすすめ

転載: blog.csdn.net/jeikerxiao/article/details/100576470