Windows system >> Windowsの知識 >  >> Linuxシステムチュートリアル >> LinuxシステムFAQ >> 街全体でnginxのプロキシアクセス

街全体でnginxのプロキシアクセス

  
        

需要:

都市--- VPN --- B市(ロケーションサーバ)、C B市都市アクセスサーバは、公共行く必要ので、都市Bを開くために、公開の必要性が、Bプロキシ経由でインターネットにホストプログラムに割り当てられた都市のパブリックネットワークIP。
計画はnginxのプロキシを介して確定された、C市---- -------公共都市--- VPN ----- B市(サーバー)。 1、ホストのパブリックIPアドレスとポートへのマッピング。 2、DNS 3、nginxのプロキシ設定[ルート@壁nginxの] $猫nginx.conf#basicuser nginxのは、1 worker_processes; PID /var/run/nginx.pid;worker_rlimit_nofile 202400;イベント{使用するファイルディスクリプタを、202400をworker_connections;} HTTP 300S fastcgi_read_timeout; 300S fastcgi_send_timeout; default_typeアプリケーション/オクテットのストリーム;上fastcgi_intercept_errors、文字セットUTF-8とのmime.typesを含む128 server_names_hash_bucket_size、4Kをclient_header_buffer_size; 4 32Kをlarge_client_header_buffers; client_max_body_sizeの999メートル;のsendfileに、上TCP_NOPUSH; keepalive_timeout {300S fastcgi_connect_timeout 60; client_body_buffer_sizeの512K;上のTCP_NODELAY proxy_connect_timeout 5; 28400をproxy_read_timeout、28400をproxy_send_timeout、16Kをproxy_buffer_size; proxy_buffers 4 64K、128Kをproxy_busy_buffers_size、128Kをproxy_temp_file_write_size、GZIPに、#gzip_disable" msie6"; gzip_disable" MSIE [1-6] \\ 。"; gzip_min_length 1K; gzip_buffers 4 16K; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text /plainのアプリケーション/X-ジャバスクリプトテキスト/CSSのアプリケーション/XML、オンgzip_vary;オフ#server_tag;オフ#server_info;オフ#server_tokens; ### 2012年12月19日変更nginxののlogslog_format「$ HTTP_X_FORWARDED_FORメイン - $のREMOTE_USER [$ time_local]" $ HTTP_HOST"" $要求"。 '' $ステータスの$ body_bytes_sent" $ HTTP_REFERER" '' " $ HTTP_USER_AGENT" $ REQUEST_TIME $ REMOTE_ADDR「; ########################## ################################################## #######################################負荷vhostincludeの/etc/nginx/conf.d/* .confの;} [ルート@壁のnginx] $ cdconf.d /fastcgi_params.default mime.types.default scgi_params.defaultfastcgi.conf KOI-UTF nginx.conf uwsgi_paramsfastcgi.conf.default KOI-Winのnginx.conf.defaultのuwsgi_params。 defaultfastcgi_paramsのmime.typesのscgi_params勝利-UTF [ルート@壁のnginx] $のCDのconf.d /[ルート@壁conf.d] $のlswall.conf [ルート@壁conf.d] $猫wall.confupstream壁{サーバー192.168。 1.2:80;(B都市サーバアドレス)#check間隔= 3000立ち上がり= 2立ち下がり= 5タイムアウト= 30000; SERVER_NAME壁*;}サーバー{83を聴く位置/{proxy_next_u pstream http_502 http_504エラータイムアウトinvalid_header; proxy_set_headerホスト$ホスト; proxy_set_header X-のReal-IPの$ REMOTE_ADDR; pr​​oxy_set_headerはX-転送さ-について$ proxy_add_x_forwarded_for; #proxy_set_headerのX-転送さ-プロトHTTPS; proxy_passます。http://壁;オフ期限が切れ;} }

Copyright © Windowsの知識 All Rights Reserved