×ðÁú¿­Ê±

ÔõÑùʹÓÃNginx Proxy ManagerʵÏÖHTTPµ½HTTPSµÄ×Ô¶¯Ìøת

ÔõÑùʹÓÃNginx Proxy ManagerʵÏÖHTTPµ½HTTPSµÄ×Ô¶¯Ìøת

Ëæ×Å»¥ÁªÍøµÄÉú³¤ £¬Ô½À´Ô½¶àµÄÍøÕ¾×îÏȽÓÄÉHTTPSЭÒéÀ´¼ÓÃÜ´«ÊäÊý¾Ý £¬ÒÔÌá¸ßÊý¾ÝµÄÇå¾²ÐÔºÍÓû§µÄÒþ˽±£»¤¡£ÓÉÓÚHTTPSЭÒéÐèÒªSSLÖ¤ÊéµÄÖ§³Ö £¬Òò´ËÔÚ°²ÅÅHTTPSЭÒéʱÐèÒªÓÐÒ»¶¨µÄÊÖÒÕÖ§³Ö¡£NginxÊÇÒ»¿îÇ¿Ê¢ÇÒ³£ÓõÄHTTPЧÀÍÆ÷ºÍ·´ÏòÊðÀíЧÀÍÆ÷ £¬¶øNginx Proxy ManagerÊÇÒ»¸ö»ùÓÚNginxµÄ¼òÆÓÒ×ÓõÄÊðÀíÖÎÀíÆ÷ £¬¿ÉÒÔʵÏÖHTTPµ½HTTPSµÄ×Ô¶¯Ìøת¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃNginx Proxy ManagerÀ´ÊµÏÖÕâÒ»¹¦Ð§ £¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£

°ì·¨Ò»£º×°ÖÃNginx Proxy Manager

Ê×ÏÈ £¬ÐèÒªÔÚЧÀÍÆ÷ÉÏ×°ÖÃNginx Proxy Manager¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´×°Öãº

$ git clone https://github.com/jc21/nginx-proxy-manager.git
$ cd nginx-proxy-manager
$ docker-compose up -d

µÇ¼ºó¸´ÖÆ

Õ⽫ÔÚЧÀÍÆ÷ÉÏÆô¶¯Ò»¸öDockerÈÝÆ÷ £¬ÆäÖаüÀ¨ÁËNginxЧÀÍÆ÷ºÍNginx Proxy ManagerÖÎÀí½çÃæ¡£

°ì·¨¶þ£ºÉèÖÃÓòÃûºÍSSLÖ¤Êé

½øÈëNginx Proxy ManagerÖÎÀí½çÃæ £¬Í¨¹ýä¯ÀÀÆ÷»á¼ûЧÀÍÆ÷µÄIPµØµã £¬Ê¹ÓÃĬÈϵÄÓû§ÃûºÍÃÜÂëµÇ¼¡£

ÔÚ½çÃæµÄ×ó²àµ¼º½À¸ÖÐ £¬Ñ¡Ôñ¡°Proxy Hosts¡± £¬È»ºóµã»÷¡°Ìí¼ÓÖ÷»ú¡±°´Å¥¡£ÔÚµ¯³öµÄ¶Ô»°¿òÖÐ £¬ÊäÈëÓòÃûÐÅÏ¢ºÍSSLÖ¤ÊéµÄÏà¹ØÐÅÏ¢¡£È·±£Ñ¡ÔñÁË¡°Force SSL¡±Ñ¡ÏîÀ´Ç¿ÖÆÆôÓÃHTTPS¡£

°ì·¨Èý£ºÉèÖÃHTTPµ½HTTPSµÄ×Ô¶¯Ìøת

ÔÚNginx Proxy ManagerÖÎÀí½çÃæÖÐ £¬Ñ¡Ôñ¡°Proxy Hosts¡±Ñ¡Ïî £¬²¢ÕÒµ½¸Õ¸ÕÌí¼ÓµÄÖ÷»ú¡£µã»÷Ö÷»úµÄÃû³Æ½øÈëÉèÖÃÒ³Ãæ¡£

ÔÚÉèÖÃÒ³ÃæµÄ¶¥²¿ £¬ÕÒµ½¡°SSL Proxy¡±Ñ¡Ïî¡£ÔÚ¡°Redirects¡±ÏÂÀ­²Ëµ¥ÖÐ £¬Ñ¡Ôñ¡°Redirect All Traffic to HTTPS¡±¡£

µã»÷Ò³Ãæµ×²¿µÄ¡°ÉúÑÄ¡±°´Å¥ £¬ÉúÑÄÉèÖò¢Ó¦Óøü¸Ä¡£

°ì·¨ËÄ£ºÑéÖ¤ÉèÖÃÊÇ·ñÉúЧ

ÖØÐÂÆô¶¯Nginx Proxy ManagerÈÝÆ÷ £¬ÒÔʹÉèÖÃÉúЧ¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´ÖØÐÂÆô¶¯ÈÝÆ÷£º

$ cd nginx-proxy-manager
$ docker-compose restart

µÇ¼ºó¸´ÖÆ

È»ºó £¬Í¨¹ýä¯ÀÀÆ÷»á¼ûÉèÖõÄÓòÃû £¬ÈôÊÇÒ»ÇÐÕý³£ £¬»á¼û½«×Ô¶¯Ìøתµ½HTTPSЭÒé £¬²¢ÇÒä¯ÀÀÆ÷µØµãÀ¸»áÏÔʾһ¸öËøͼ±ê £¬ÌåÏÖÅþÁ¬ÊÇÇå¾²µÄ¡£

´úÂëʾÀý£º

server {
    listen 80;
    server_name example.com;
    return 301 https://example.com$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com;
    
    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;
    
    # other configuration...
}

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÃæµÄʾÀýÖÐ £¬µÚÒ»¸öserver¿é¼àÌý80¶Ë¿Ú £¬²¢Í¨¹ýreturn 301Ö¸Áî·µ»ØÒ»¸ö301Öض¨Ïòµ½HTTPS¡£µÚ¶þ¸öserver¿é¼àÌý443¶Ë¿Ú £¬²¢ÉèÖÃÁËSSLÖ¤ÊéµÄ·¾¶ £¬²¢¿ÉÒÔƾ֤ÐèÒªÌí¼ÓÆäËûµÄÉèÖá£

×ܽ᣺

ͨ¹ýʹÓÃNginx Proxy Manager £¬ÎÒÃÇ¿ÉÒÔºÜÀû±ãµØʵÏÖHTTPµ½HTTPSµÄ×Ô¶¯Ìøת¡£Ö»ÐèÒªÔÚÉèÖýçÃæÖÐÑ¡ÔñÏìÓ¦µÄÑ¡Ïî £¬¾Í¿ÉÒÔÍê³ÉÏà¹ØµÄÉèÖá£Nginx Proxy Manager²»µ«¼ò»¯ÁËHTTPSЭÒéµÄ°²ÅÅÊÂÇé £¬»¹ÌṩÁËÓѺõÄÖÎÀí½çÃæ £¬Àû±ãÓû§¾ÙÐÐÏà¹Ø²Ù×÷¡£Ï£Íû±¾ÎÄÄܶԸ÷ÈËÃ÷È·²¢Ê¹ÓÃNginx Proxy ManagerÓÐËù×ÊÖú¡£

ÒÔÉϾÍÊÇÔõÑùʹÓÃNginx Proxy ManagerʵÏÖHTTPµ½HTTPSµÄ×Ô¶¯ÌøתµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

13452372176

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

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

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