尊龙凯时人生就是博

nginxÔõô»á¼ûservlet

ʹÓà nginx »á¼û servlet ÐèÒª×ñÕÕÒÔÏ°취£ºÆôÓò¢ÉèÖà nginx µÄ ajp Ä £¿é £¬²¢ÔÚÓ¦ÓóÌÐòЧÀÍÆ÷ÖÐÉèÖà ajp ÅþÁ¬Æ÷¡£Í¨¹ý nginx µÄ location ¿é½« nginx ÓëÓ¦ÓóÌÐòЧÀÍÆ÷ÅþÁ¬ £¬Ê¹Óà ajp ЭÒé¾ÙÐÐÊý¾Ý´«Êä¡£Íê³ÉÕâЩ°ì·¨ºó £¬¼´¿Éͨ¹ý nginx »á¼û servlet¡£

ÔõÑùÓà Nginx »á¼û Servlet

ΪÁËÓà Nginx »á¼û Servlet £¬ÐèÒª×ñÕÕÒÔÏ°취£º

1. ÆôÓà AJP Ä £¿é

ÐÞ¸Ä Nginx ÉèÖÃÎļþ£¨nginx.conf£© £¬ÆôÓà AJP Ä £¿é£º

load_module modules/ngx_http_ajp_module.so;

µÇ¼ºó¸´ÖÆ

2. ½¨Éè AJP ¼àÌýÆ÷

ÔÚ Nginx ÉèÖÃÎļþÖн¨ÉèÒ»¸ö AJP ¼àÌýÆ÷ £¬Í¨³£Ê¹Óà 8009 ¶Ë¿Ú£º

server {
    listen 8009 ajp;
    server_name localhost;

    # ...ÆäËû Nginx ÉèÖÃÖ¸Áî
}

µÇ¼ºó¸´ÖÆ

3. ÉèÖÃÓ¦ÓóÌÐòЧÀÍÆ÷

ÉèÖÃÄúµÄÓ¦ÓóÌÐòЧÀÍÆ÷£¨ÀýÈç Apache Tomcat£©ÒÔʹÓà AJP ЭÒé¡£ÔÚ Tomcat µÄ server.xml ÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£º

<connector port="8009" protocol="AJP/1.3" redirectport="8443"></connector>

µÇ¼ºó¸´ÖÆ

4. ½« Nginx ÓëÓ¦ÓóÌÐòЧÀÍÆ÷ÅþÁ¬

ÔÚ Nginx ÉèÖÃÎļþÖÐ £¬Ê¹Óà location ¿é½« Nginx ÅþÁ¬µ½Ó¦ÓóÌÐòЧÀÍÆ÷£º

location /servlet/* {
    proxy_pass http://localhost:8009;
    proxy_set_header AJP_REMOTE_ADDR $remote_addr;
    proxy_set_header AJP_REMOTE_HOST $remote_addr;
}

µÇ¼ºó¸´ÖÆ

ÏÖÔÚ £¬Äú¿ÉÒÔʹÓà AJP ЭÒéͨ¹ý Nginx »á¼û Servlet¡£

ÒÔÉϾÍÊÇnginxÔõô»á¼ûservletµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ