Nginx Proxy ManagerµÄÐÔÄÜÓÅ»¯Óëµ÷Óż¼ÇÉ
Nginx Proxy ManagerµÄÐÔÄÜÓÅ»¯Óëµ÷Óż¼ÇÉ
СÐò£º
Nginx Proxy ManagerÊÇÒ»¿î»ùÓÚNginxµÄÊðÀíЧÀÍÆ÷ÖÎÀí¹¤¾ß£¬Ëü¿ÉÒÔ×ÊÖúÎÒÃǼò»¯ÊðÀíЧÀÍÆ÷µÄÉèÖúÍÖÎÀí¡£ÔÚÏÖʵӦÓÃÖУ¬ÎªÁËÌá¸ßNginx Proxy ManagerµÄÐÔÄÜ£¬ÎÒÃÇÐèÒª¾ÙÐÐһЩÓÅ»¯ºÍµ÷ÓÅ¡£±¾ÎĽ«ÏÈÈÝһЩ³£ÓõÄÐÔÄÜÓÅ»¯ºÍµ÷Óż¼ÇÉ£¬²¢ÌṩÏêϸµÄ´úÂëʾÀý£¬Ï£ÍûÄܶԶÁÕßÓÐËù×ÊÖú¡£
Ò»¡¢ÆôÓÃHTTP2ÐÒé
HTTP2ÊÇÒ»ÖÖÓÃÓÚ´«ÊäÍøÒ³ÄÚÈݺͷַ¢Á÷ʽýÌåµÄÐÂÐÒ飬Ïà±È¹Å°åµÄHTTPÐÒ飬ËüÄܹ»Ìá¸ßÒ³ÃæµÄ¼ÓÔØËÙÂʺÍÐÔÄÜ¡£ÔÚNginx Proxy ManagerÖÐÆôÓÃHTTP2ÐÒéºÜÊǼòÆÓ£¬Ö»ÐèÔÚNginxµÄÉèÖÃÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺
listen 443 ssl http2;
µÇ¼ºó¸´ÖÆ
ÕâÑù£¬Nginx Proxy Manager¾Í¿ÉÒÔͨ¹ýHTTP2ÐÒéÀ´´«ÊäÊý¾Ý£¬´Ó¶øÌáÉýÐÔÄÜ¡£
¶þ¡¢ÆôÓÃGzipѹËõ
GzipÊÇÒ»ÖÖÓÃÓÚѹËõÍøÒ³ÄÚÈݵÄÒªÁ죬Ëü¿ÉÒÔ¼õСÊý¾ÝµÄ´«ÊäÁ¿£¬Ìá¸ßÒ³ÃæµÄ¼ÓÔØËÙÂÊ¡£ÔÚNginx Proxy ManagerÖÐÆôÓÃGzipѹËõÒ²ºÜÊǼòÆÓ£¬Ö»ÐèÔÚNginxµÄÉèÖÃÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺
gzip on;
µÇ¼ºó¸´ÖÆ
ÕâÑù£¬Nginx Proxy Manager¾Í»á×Ô¶¯¶ÔÍøÒ³ÄÚÈݾÙÐÐѹËõ£¬ÔÚ´«ÊäÀú³ÌÖмõСÊý¾ÝµÄÌå»ý¡£
Èý¡¢µ÷½â»º³åÇø¾Þϸ
ÔÚNginx Proxy ManagerÖУ¬Ä¬ÈϵĻº³åÇø¾Þϸ¿ÉÄܲ»ÊʺÏijЩӦÓó¡¾°£¬ÌØÊâÊÇ´¦Àí´ó×Ú²¢·¢ÇëÇóʱ¡£ÎªÁËÌá¸ßÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔÊÖ¶¯µ÷½â»º³åÇø¾Þϸ¡£ÒÔÏÂÊÇһЩ³£ÓõĻº³åÇøÉèÖÃʾÀý£º
proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k;
µÇ¼ºó¸´ÖÆ
ÕâЩÉèÖý«µ÷½â»º³åÇøµÄ¾Þϸ£¬ÒÔ˳Ӧ²î±ðµÄ³¡¾°¡£Æ¾Ö¤ÏÖÕæÏàÐΣ¬ÎÒÃÇ¿ÉÒÔµ÷½âÒÔÉϲÎÊýµÄÖµ¡£
ËÄ¡¢Ê¹Óûº´æ
Nginx Proxy Manager»¹ÌṩÁË»º´æ¹¦Ð§£¬¿ÉÒÔ½«Ä³Ð©¾²Ì¬Îļþ»º´æµ½ÍâµØ£¬ïÔ̶ÔԴЧÀÍÆ÷µÄ»á¼û¡£ÒªÆôÓûº´æ¹¦Ð§£¬ÎÒÃÇÐèÒªÔÚNginxµÄÉèÖÃÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m use_temp_path=off; proxy_cache_key "$scheme$request_method$host$request_uri"; proxy_cache_valid any 200 301 302 404 5m;
µÇ¼ºó¸´ÖÆ
ÒÔÉÏ´úÂ뽫ÉèÖÃÒ»¸öÃûΪmy_cacheµÄ»º´æÇø£¬»º´æµÄ¾ÞϸΪ10GB£¬»º´æµÄÓÐÓÃʱ¼äΪ60·ÖÖÓ¡£Nginx Proxy Manager»áƾ֤ÉèÖõÄÌõ¼þ¶ÔijЩÇëÇó¾ÙÐлº´æ£¬´Ó¶øÌá¸ßÐÔÄÜ¡£
Îå¡¢ÉèÖÃSSL¼ÓÃÜ
ÔÚÏÖʵӦÓÃÖУ¬ÎÒÃÇͨ³£¶¼»áʹÓÃSSL¼ÓÃÜÀ´°ü¹ÜÓû§µÄÊý¾ÝÇå¾²¡£ÎªÁËÌá¸ßÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔʹÓÃһЩÓÅ»¯µÄSSLÉèÖá£ÒÔÏÂÊÇһЩ³£ÓõÄSSLÉèÖÃʾÀý£º
ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA; ssl_prefer_server_ciphers on;
µÇ¼ºó¸´ÖÆ
ÕâЩÉèÖý«ÆôÓÃTLSv1.2ºÍTLSv1.3ÐÒ飬²¢ÉèÖÃÁËһЩÓÅ»¯µÄ¼ÓÃÜÌ×¼þ¡£Æ¾Ö¤ÏÖÕæÏàÐΣ¬ÎÒÃÇ¿ÉÒÔµ÷½âÒÔÉϲÎÊýµÄÖµ¡£
½áÓ
ͨ¹ý¶ÔNginx Proxy Manager¾ÙÐÐÐÔÄÜÓÅ»¯ºÍµ÷ÓÅ£¬ÎÒÃÇ¿ÉÒÔÌá¸ßÊðÀíЧÀÍÆ÷µÄÐÔÄÜ£¬ÌáÉýÓû§µÄ»á¼ûÌåÑé¡£±¾ÎÄÏÈÈÝÁËһЩ³£ÓõÄÐÔÄÜÓÅ»¯ºÍµ÷Óż¼ÇÉ£¬²¢ÌṩÁËÏêϸµÄ´úÂëʾÀý¡£¶ÁÕß¿ÉÒÔƾ֤×Ô¼ºµÄÏÖʵÐèÇó£¬Ñ¡ÔñºÏÊʵÄÓÅ»¯ÒªÁì¾ÙÐÐÉèÖá£Ï£Íû±¾ÎĶÔÄúÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇNginx Proxy ManagerµÄÐÔÄÜÓÅ»¯Óëµ÷Óż¼ÇɵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡