Nginx Proxy ManagerÓëHTTP/2ÐÒéµÄ¼æÈÝÐÔÓÅ»¯
Nginx Proxy ManagerÓëHTTP/2ÐÒéµÄ¼æÈÝÐÔÓÅ»¯
½üÄêÀ´£¬»¥ÁªÍøµÄ¸ßËÙÉú³¤Ê¹µÃÍøÕ¾ÔÚ´¦Öóͷ£´ó×ÚÇëÇóʱÃæÁÙ×ÅÖØ´óµÄѹÁ¦£¬Òò´ËÐèÒªÒ»ÖÖ¸ü¸ßЧ¡¢¸ü¿ìËÙµÄÐÒéÀ´ÓÅ»¯ÍøÂç´«ÊäËÙÂʺÍÐÔÄÜ¡£HTTP/2ÐÒé×÷ΪHTTP/1.1ÐÒéµÄ½ø»¯°æ£¬Í¨¹ý¶à·¸´Óá¢Í·²¿Ñ¹ËõµÈÌØÕ÷ʵÏÖÁ˸ü¸ßЧµÄÊý¾Ý´«Ê䡣ΪÁ˸üºÃµØ˳ӦÕâÖÖÐÒéµÄÌØÕ÷£¬Nginx Proxy ManagerÒ²ÐèÒª¾ÙÐмæÈÝÐÔµÄÓÅ»¯¡£
Nginx Proxy ManagerÊÇÒ»¿î»ùÓÚNginxµÄ·´ÏòÊðÀí¹¤¾ß£¬Ëü¿ÉÒÔÌṩ¸ºÔØƽºâ¡¢»º´æ¡¢SSLµÈ¹¦Ð§£¬×ÊÖúÍøվʵÏÖ¸ßÐÔÄܵÄÏìÓ¦ºÍÇå¾²ÐÔ¡£ÎªÁ˼æÈÝHTTP/2ÐÒ飬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔϼ¸¸ö·½Ãæ¾ÙÐÐÓÅ»¯¡£
Ê×ÏÈ£¬¸üÐÂNginx°æ±¾¡£HTTP/2ÐÒéÒªÇóNginxµÄ°æ±¾ÔÚ1.9.5¼°ÒÔÉÏ£¬Òò´ËÐèҪȷ±£Nginx Proxy ManagerËùʹÓõÄNginx°æ±¾ÇкÏÒªÇ󡣿ÉÒÔͨ¹ý¹Ù·½ÍøÕ¾ÏÂÔØ×îеÄÎȹ̰汾£¬²¢¾ÙÐÐÏìÓ¦µÄ×°ÖúÍÉèÖá£
Æä´Î£¬ÆôÓÃHTTP/2ÐÒé¡£ÔÚNginxµÄÉèÖÃÎļþÖУ¬ÐÂÔö»ò±à¼ÒÔÏÂÉèÖÃÏîʹµÃNginxÖ§³ÖHTTP/2ÐÒ飺
listen 443 ssl http2;
µÇ¼ºó¸´ÖÆ
ÕâÑù£¬Nginx½«»áÔÚ443¶Ë¿ÚÉÏÆôÓÃHTTP/2ÐÒ飬²¢ÇÒÆôÓÃÁËSSL¼ÓÃÜ¡£
È»ºó£¬ÓÅ»¯TLSÉèÖá£HTTP/2ÐÒéÒªÇóʹÓÃTLSÀ´°ü¹ÜÊý¾ÝµÄÇå¾²ÐÔ£¬Òò´ËÐèÒª¶ÔTLS¾ÙÐÐÓÅ»¯¡£¿ÉÒÔÑ¡ÔñʹÓÃ×îеÄTLS°æ±¾£¬²¢¿ªÆôÐëÒªµÄ¼ÓÃÜËã·¨£¬ÈçÏÂËùʾ£º
ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA";
µÇ¼ºó¸´ÖÆ
ÕâЩÉèÖÿÉÒÔƾ֤ÏÖÕæÏàÐξÙÐе÷½â£¬ÒÔÔÚÇå¾²ÐÔºÍÐÔÄÜÖ®¼äÈ¡µÃƽºâ¡£
½Ó×Å£¬ÉèÖÃЧÀÍÆ÷ÍÆËÍ¡£HTTP/2ÐÒéÖ§³ÖЧÀÍÆ÷ÍÆËÍ£¬¼´ÔÚ¿Í»§¶ËÇëÇóµÄͬʱ£¬Ð§ÀÍÆ÷¿ÉÒÔ×Ô¶¯ÍÆËÍÏà¹ØµÄ×ÊÔ´¡£¿ÉÒÔͨ¹ýÒÔÏÂÉèÖý«Ð§ÀÍÆ÷ÍÆËÍÓ¦ÓÃÓÚNginx£º
http2_push /path/to/resource;
µÇ¼ºó¸´ÖÆ
ÕâÑù£¬µ±¿Í»§¶ËÇëÇóij¸ö×ÊԴʱ£¬Nginx»á×Ô¶¯Ïò¿Í»§¶ËÍÆË͸Ã×ÊÔ´µÄÏà¹ØÎļþ£¬´Ó¶øÌá¸ßÓû§ÌåÑé¡£
×îºó£¬Ê¹ÓÃÓÅ»¯µÄWeb×ÊÔ´¡£HTTP/2ÐÒéÖ§³Ö¶à·¸´Ó㬼´ÔÚͳһ¸öÅþÁ¬ÉÏ¿ÉÒÔͬʱ¾ÙÐжà¸öÇëÇóºÍÏìÓ¦¡£Òò´Ë£¬ÎÒÃÇ¿ÉÒÔ½«¶à¸öCSSÎļþºÍ¶à¸öJavaScriptÎļþºÏ²¢ÎªÒ»¸öÎļþ£¬ÒÔïÔÌÅþÁ¬ÊýºÍÌá¸ßÐÔÄÜ¡£¿ÉÒÔͨ¹ýWebpackµÈ¹¤¾ß¾ÙÐÐ×ÊÔ´µÄÓÅ»¯ºÍºÏ²¢£¬´Ó¶øÔÚHTTP/2ÐÒéÏÂÊ©Õ¹×î´óµÄÐÔÄÜÓÅÊÆ¡£
ÐèҪעÖصÄÊÇ£¬ÎªÁ˼æÈÝHTTP/2ÐÒ飬Nginx Proxy ManagerÖÐËùʹÓõĺó¶ËЧÀÍÆ÷Ò²ÐèÒªÖ§³ÖHTTP/2ÐÒé¡£¿ÉÒÔͨ¹ý¼ì²éºó¶ËЧÀÍÆ÷µÄNginx°æ±¾ºÍÉèÖã¬À´È·±£ÆäÇкÏHTTP/2ÐÒéµÄÒªÇó¡£
×ܽá¶øÑÔ£¬ÎªÁËÌá¸ßNginx Proxy ManagerÓëHTTP/2ÐÒéµÄ¼æÈÝÐÔ£¬ÎÒÃÇÐèÒª¸üÐÂNginx°æ±¾¡¢ÆôÓÃHTTP/2ÐÒé¡¢ÓÅ»¯TLSÉèÖá¢ÉèÖÃЧÀÍÆ÷ÍÆËÍÒÔ¼°Ê¹ÓÃÓÅ»¯µÄWeb×ÊÔ´¡£Í¨¹ýÕâЩÓÅ»¯²½·¥£¬ÎÒÃÇ¿ÉÒÔ³ä·ÖʹÓÃHTTP/2ÐÒéµÄÌØÕ÷£¬Ìá¸ßÍøÕ¾µÄÐÔÄܺÍÏìÓ¦ËÙÂÊ¡£
ÒÔÉϾÍÊÇNginx Proxy ManagerÓëHTTP/2ÐÒéµÄ¼æÈÝÐÔÓÅ»¯µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡