<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # linux下使用nginx反向代理搭建負載均衡 ##1、本地虛擬機搭建 1、在本地搭建三臺虛擬機配置分別如下: ~~~ server { listen 81; server_name 127.0.0.1; index index.html index.htm index.php; root /home/wwwroot/hlsc1/; #access_log /home/wwwroot/pigcms/logs/pigaccess.log; rewrite_log on; #error_log /home/wwwroot/pigcms/logs/error.log debug; #access_log /home/wwwroot/pigcms/logs/pigaccess.log; location ~ .*\.(php|php5)?$ { #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #include fastcgi.conf; include enable-php.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } #access_log /home/wwwroot/pigcms/logs/default.log; } ~~~ ~~~ server { listen 82; server_name 127.0.0.1; index index.html index.htm index.php; root /home/wwwroot/hlsc2/; #access_log /home/wwwroot/pigcms/logs/pigaccess.log; rewrite_log on; #error_log /home/wwwroot/pigcms/logs/error.log debug; #access_log /home/wwwroot/pigcms/logs/pigaccess.log; location ~ .*\.(php|php5)?$ { #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #include fastcgi.conf; include enable-php.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } #access_log /home/wwwroot/pigcms/logs/default.log; } ~~~ ##配置負載均衡的配置參數 `touch fzjh.conf` 加入如下代碼 ~~~ user www www;# 用戶 用戶組 worker_processes 4;#開啟的進程 一般是cpu的一倍或者兩倍 events{ worker_connections 1024; #最大鏈接數 } http{ upstream mypro #此處是負載均衡的服務器集群的地址列表 { #ip_hash; #這里有三個參數 #ip_hash按照ip的哈希值分配服務器 這樣解決了 session的問題 #fair(第三方) 按后端服務器的響應時間來分配請求,響應時間短的優先分配 #url_hash(第三方)按訪問url的hash結果來分配請求,使每個url定向到同一個后端服務器,后端服務器為緩存時比較有效。    server 127.0.0.1:80 weight=2; server 127.0.0.1:81 weight=2; server 127.0.0.1:82 weight=2; } server #提供反向代理的服務監聽 { listen 8080; location /{ proxy_pass http://mypro; } } } ~~~ ##加載配置參數 `/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/fzjh.conf` ~~~ killall -9 nginx #殺死nginx的所有進程 service nginx start #啟動nginx進程 ~~~ 或者跟隨服務器啟動如下代碼 ~~~ user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; multi_accept on; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 50m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 256k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\."; #limit_conn_zone $binary_remote_addr zone=perip:10m; ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section. server_tokens off; #log format log_format access '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; access_log off; upstream mypro # { #ip_hash; server 127.0.0.1:80 weight=2; server 127.0.0.1:81 weight=2; server 127.0.0.1:82 weight=2; } server { #listen 443 default_server; listen 80; server_name 127.0.0.1; index index.html index.htm index.php; root /home/wwwroot/default; #error_page 404 /404.html; include enable-php.conf; location /nginx_status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } #ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server.key; access_log /home/wwwlogs/access.log access; } server { listen 8080; location /{ proxy_pass http://mypro; } } include vhost/*.conf; } ~~~ ##參考文章 http://www.server110.com/nginx/201403/7113.html
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看