自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Linux Nginx配置nginx.conf效率很高

運(yùn)維 系統(tǒng)運(yùn)維
Linux Nginx啟動(dòng)181上的3個(gè)tomcat,修改tomcat首頁加入端口信息,以用來清晰看到當(dāng)前分配到那臺(tái)tomcat啟動(dòng)Linux Nginx,訪問 http://sp.imichat.com/可看到請(qǐng)求被發(fā)送到3臺(tái)服務(wù)器。

Linux Nginx 還是比較常用的,于是我研究了一下Linux Nginx ,在這里拿出來和大家分享一下,希望對(duì)大家有用。Linux Nginx 已經(jīng)是目前公認(rèn)的效率很高的代理服務(wù),同時(shí)可以用來做負(fù)載均衡。由于項(xiàng)目目前只有一臺(tái)centOS的服務(wù)器,無法用來測(cè)試,所以打算找下Linux Nginx windows下版本;http://www.kevinworthington.com/nginx/win32/以上為win32的版本用戶訪問 sp.imichat.com 均衡到 10.10.10.181:8080; 10.10.10.181:8081; 10.10.10.181:8082; 這3臺(tái)服務(wù)器

配置Linux Nginx的nginx.conf

  1. http {}增加如下內(nèi)容  
  2. upstream sp.imichat.com {   
  3. server 10.10.10.181:8080;   
  4. server 10.10.10.181:8081;   
  5. server 10.10.10.181:8082; }  
  6. server {} 修改異俠信息:  
  7. listen 80;  
  8. server_name sp.imichat.com;  
  9. #charset koi8-r;  
  10. #access_log logs/host_access_log main;  
  11. location / {  
  12. proxy_pass http://sp.imichat.com;  
  13. proxy_set_header Host $host;  
  14. proxy_set_header X-Real-IP $remote_addr;  
  15. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
  16. }  
  17. access_log logs/sp.imichat.com.log combined;  
  18. [/code] 

Linux Nginx啟動(dòng)181上的3個(gè)tomcat,修改tomcat首頁加入端口信息,以用來清晰看到當(dāng)前分配到那臺(tái)tomcat啟動(dòng)Linux Nginx,訪問 http://sp.imichat.com/可看到請(qǐng)求被發(fā)送到3臺(tái)服務(wù)器。

Linux Nginx抓http包可看到request為

  1. GET / HTTP/1.1  
  2. Host: sp.imichat.com  
  3. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4  
  4. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8  
  5. Accept-Language: en-us,zh-cn;q=0.5  
  6. Accept-Encoding: gzip,deflate  
  7. Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7  
  8. Keep-Alive: 300  
  9. Connection: keep-alive  
  10. Cookie: JSESSIONID=A75E09D2EBF769A7BD95195E29DE87DEkey=1227008000183;   
  11. memberName=adminmemberType=%7C%u8D85%u7EA7%u7BA1%u7406%u5458%7C  
  12. Pragma: no-cache  
  13. Cache-Control: no-cache 
  1. response:  
  2. HTTP/1.1 200 OK  
  3. Server: nginx/0.7.21-win32  
  4. Date: Tue, 18 Nov 2008 12:12:33 GMT  
  5. Content-Type: text/html  
  6. Connection: keep-alive  
  7. ETag: W/"8157-1227009260637"  
  8. Last-Modified: Tue, 18 Nov 2008 11:54:20 GMT  
  9. Content-Length: 8157 

【編輯推薦】

  1. Linux Nginx安裝編譯MySQL 5.1.34擴(kuò)展庫(kù)及Php Web服務(wù)器
  2. Linux系統(tǒng)穩(wěn)定性和安全性要更強(qiáng)
  3. Linux vsFTPD安裝與配置文件和配置虛擬用戶
  4. Linux MYSQL命令修改各種連接的這那方法
  5. Linux MySQL程序服務(wù)內(nèi)建安全機(jī)制
責(zé)任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-02-06 10:24:52

CentOS Ngin

2017-12-28 10:22:28

NginxFastCGIPHP-fpm

2022-07-12 17:24:48

NginxDocker

2024-10-17 16:30:28

2020-06-18 09:10:10

開源技術(shù) Nginx

2010-03-30 15:25:42

Linux Nginx

2024-11-15 10:58:40

2013-06-05 13:31:25

2014-03-28 14:20:04

2024-06-13 10:16:29

2010-02-06 14:00:05

Linux Nginx

2011-11-28 15:26:40

Nginx配置

2019-09-09 11:02:17

Nginx進(jìn)程模型

2011-11-28 22:18:53

Nginxtomcat集群

2024-03-26 12:08:20

加密NginxHTTP

2023-08-30 08:51:41

NginxLinux

2013-08-15 13:41:53

Nginx用戶認(rèn)證

2014-04-04 10:16:51

Nginx配置Nginx性能優(yōu)化

2014-04-29 14:54:48

Nginx反向代理

2014-07-28 11:37:49

NginxTomcat
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)