日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
ngnix配置文件如何達(dá)到負(fù)載均衡

ngnix配置文件在使用的時(shí)候需要進(jìn)行負(fù)載均衡,但是要如何才能完整這一個(gè)動(dòng)作呢?下面我們就向大家介紹我的ngnix配置文件(nginx +tomcat包括 虛擬目錄,負(fù)載均衡和url_Rewrite)

 
 
 
  1. #user nobody;  
  2. worker_processes 10;  
  3. error_log /home/weblogs/error.log crit;  
  4. #error_log logs/error.log notice;  
  5. #error_log logs/error.log info;  
  6. pid logs/nginx.pid;  
  7. worker_rlimit_nofile 51200;  
  8. events {  
  9. use epoll;  
  10. worker_connections 51200;  
  11. }  
  12. http {  
  13. include mime.types;  
  14. default_type application/octet-stream;  
  15. include proxy.conf;   
  16. log_format main '$remote_addr - $remote_user [$time_local] $request '  
  17. '"$status" $body_bytes_sent "$http_referer" '  
  18. '"$http_user_agent" "$http_x_forwarded_for"';  
  19. access_log /home/weblogs/access.log main;  
  20. server_names_hash_bucket_size 128;  
  21. #sendfile on;  
  22. #tcp_nopush on;  
  23. # tcp_nodelay on;  
  24. #keepalive_timeout 0;  
  25. #keepalive_timeout 60;  
  26. #gzip off;  
  27. #gzip_min_length 1k;  
  28. #gzip_buffers 4 8k;  
  29. #gzip_http_version 1.1;   
  30. #gzip_types text/plain application/x-javascript text/css text/html application/xml;  
  31. client_header_buffer_size 32k;  
  32. large_client_header_buffers 4 32k;  
  33. sendfile on;  
  34. tcp_nopush on;  
  35. keepalive_timeout 60;  
  36. tcp_nodelay on;  
  37. gzip on;  
  38. gzip_min_length 1k;  
  39. gzip_buffers 4 16k;  
  40. gzip_http_version 1.0;  
  41. gzip_comp_level 2;  
  42. gzip_types text/plain application/x-javascript text/css application/xml;  
  43. gzip_vary on;  
  44. upstream hljbstCms {  
  45. #ip_hash;  
  46. server localhost:8080 ;  
  47. server localhost:8081;  
  48. }  
  49. server {  
  50. server_name _;  
  51. listen 80;  
  52. charset gb2312;   
  53. location /(WEB-INF)/ {   
  54. deny all;   
  55. }   
  56. location /html/ {  
  57. index index.html;  
  58. root /home;  
  59. }  
  60. location /img/{  
  61. root /home;  
  62. }  
  63. location /res/{  
  64. root /home;  
  65. }  
  66. location / {  
  67. if ($host ~* "^[a-z0-9\-]+\.hljbst\.com$"){  
  68. rewrite ^/?$ /$host last;  
  69. rewrite ^/([a-z0-9\-]+)\.hljbst\.com/?$ http://$host/site/$1 permanent;  
  70. }   
  71. proxy_pass http://hljbstCms;  
  72. include proxy.conf;   
  73. }  
  74. location /NginxStatus {  
  75. #stub_status on;  
  76. access_log on;  
  77. auth_basic "NginxStatus";  
  78. auth_basic_user_file conf/htpasswd;  
  79. }  
  80. #error_page 404 /404.html;  
  81. # redirect server error pages to the static page /50x.html  
  82. #  
  83. error_page 500 502 503 504 /50x.html;  
  84. location = /50x.html {  
  85. root /home/ngnix/html;  
  86. }  
  87. }  

以上就是對(duì)ngnix配置文件的詳細(xì)介紹。

【編輯推薦】

  1. nginx配置中運(yùn)行與啟動(dòng)的詳細(xì)介紹
  2. nginx服務(wù)器如何處理相關(guān)的圖片
  3. nginx配置相關(guān)結(jié)構(gòu)劃分的技巧
  4. nginx配置文件實(shí)現(xiàn)AWStats靜態(tài)頁面
  5. nginx 禁止IP訪問的代碼編寫教程

新聞名稱:ngnix配置文件如何達(dá)到負(fù)載均衡
瀏覽路徑:http://www.5511xx.com/article/dhphegs.html