×ðÁú¿­Ê±¹ÙÍøµÇ¼

¹¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ£ºÊ¹ÓÃNginx Proxy ManagerʵÏÖÁ÷Á¿¸ôÀë

¹¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ£ºÊ¹ÓÃNginx Proxy ManagerʵÏÖÁ÷Á¿¸ôÀë

Ëæ×ÅÔÆÅÌËãºÍÈÝÆ÷»¯ÊÖÒÕµÄÒ»Ö±Éú³¤ £¬Ô½À´Ô½¶àµÄÆóÒµºÍ¿ª·¢Õß×îÏÈʹÓÃÈÝÆ÷À´ÍйܺÍÖÎÀíËûÃǵÄÓ¦ÓóÌÐò¡£¶øΪÁË°ü¹ÜÈÝÆ÷ЧÀ͵ÄÇå¾²¿É¿¿ £¬Á÷Á¿¸ôÀëÊÇÒ»¸ö²»¿É»òȱµÄ»·½Ú¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃNginx Proxy Manager£¨ÒÔϼò³ÆNPM£©À´¹¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ £¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£

NPMÏÈÈÝ

NPMÊÇÒ»¸ö»ùÓÚNginxµÄÊðÀíÖÎÀí¹¤¾ß £¬ËüÌṩÁËÒ»¸öÓû§ÓѺõĽçÃæ £¬¿ÉÒÔ¿ìËÙÉèÖúÍÖÎÀí·´ÏòÊðÀí¡¢¸ºÔØƽºâ¡¢SSLÖ¤ÊéµÈ¹¦Ð§¡£Í¨¹ýNPM £¬ÎÒÃÇ¿ÉÒÔʵÏÖ¶ÔÈÝÆ÷ЧÀ͵ÄÁ÷Á¿¸ôÀë £¬Ìá¸ßÇå¾²ÐԺͿɿ¿ÐÔ¡£

×°ÖúÍÉèÖÃNPM

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÔÚЧÀÍÆ÷ÉÏ×°ÖÃNPM¡£ÇëÈ·±£ÄãµÄЧÀÍÆ÷ÒѾ­×°ÖÃÁËNginx £¬²¢ÇÒ¿ªÆôÁËDocker¹¦Ð§¡£

½ÓÏÂÀ´ £¬Ê¹ÓÃÒÔÏÂÏÂÁî×°ÖÃNPM£º

docker run --restart always -d -p 81:81 -p 443:443 -v npmdata:/data -v /var/run/docker.sock:/var/run/docker.sock jlesage/nginx-proxy-manager

µÇ¼ºó¸´ÖÆ

¸ÃÏÂÁÔÚЧÀÍÆ÷ÉÏÆô¶¯Ò»¸öNPMÈÝÆ÷ £¬²¢½«¶Ë¿Ú81ºÍ443Ó³Éäµ½Ö÷»úµÄ¶ÔÓ¦¶Ë¿ÚÉÏ¡£

Æô¶¯Íê³Éºó £¬Ê¹ÓÃä¯ÀÀÆ÷»á¼ûЧÀÍÆ÷IPµØµã £¬¼ÓÉ϶˿ںÅ81£¨ÀýÈ磺http://server_ip:81£© £¬½øÈëNPMµÄÖÎÀí½çÃæ¡£

ÉèÖÃÈÝÆ÷ЧÀÍ

ÔÚNPMµÄÖÎÀí½çÃæ £¬ÎÒÃÇ¿ÉÒÔÀû±ãµØÉèÖúÍÖÎÀíÈÝÆ÷ЧÀÍ¡£ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄʾÀý£º

Ê×ÏÈ £¬ÔÚNPM½çÃæµÄ×ó²àµ¼º½À¸ÖÐ £¬µã»÷¡°Proxy Hosts¡± £¬È»ºóµã»÷¡°Add Proxy Host¡±°´Å¥¡£

ÔÚµ¯³öµÄ´°¿ÚÖÐ £¬ÌîдÒÔÏÂÐÅÏ¢£º

Domain Names: ÊäÈëÄãµÄÓòÃû £¬ÓÃÓÚ»á¼ûÈÝÆ÷ЧÀÍ¡£

Scheme: Ñ¡ÔñЭÒéÀàÐÍ £¬Ò»Ñùƽ³£Ñ¡Ôñ¡°http¡±»ò¡°https¡±¡£

Forward Hostname/IP: ÊäÈëÈÝÆ÷ЧÀ͵ÄIPµØµã»òÖ÷»úÃû³Æ¡£

Forward Port: ÊäÈëÈÝÆ÷ЧÀ͵Ķ˿ںÅ¡£

µã»÷¡°Save¡±ÉúÑÄÉèÖá£

SSLÖ¤ÊéÉèÖÃ

ΪÁË°ü¹ÜÊý¾Ý´«ÊäµÄÇå¾²ÐÔ £¬ÎÒÃÇ»¹¿ÉÒÔÉèÖÃSSLÖ¤Êé¡£ÔÚNPMµÄÖÎÀí½çÃæ £¬µã»÷¡°SSL Certificates¡± £¬È»ºóµã»÷¡°Add Certificate¡±°´Å¥¡£

ÔÚµ¯³öµÄ´°¿ÚÖÐ £¬ÌîдÒÔÏÂÐÅÏ¢£º

Domain: ÊäÈëÄãµÄÓòÃû¡£

E-Mail: ÊäÈëÄãµÄÓÊÏäµØµã £¬ÓÃÓÚÖ¤ÊéÏà¹Ø֪ͨ¡£

µã»÷¡°Save¡±ÉúÑÄÉèÖá£

ʾÀý´úÂëʵÏÖ

ÒÔÏÂÊÇÒ»¸ö»ùÓÚDockerµÄNode.jsÓ¦ÓõÄʾÀý´úÂë £¬ÑÝʾÁËÔõÑùÔÚÈÝÆ÷ÇéÐÎÏÂʹÓÃNPMʵÏÖÁ÷Á¿¸ôÀ룺

const express = require('express');
const app = express();
const port = 3000;

app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`);
});

µÇ¼ºó¸´ÖÆ

ͨ¹ýÒÔÉÏ´úÂë £¬ÎÒÃǽ¨ÉèÁËÒ»¸ö¼òÆÓµÄExpressÓ¦Óà £¬¼àÌý¶Ë¿Ú3000 £¬²¢·µ»Ø¡°Hello World!¡±¡£

½«¸ÃÓ¦Óôò°ü³ÉDocker¾µÏñ £¬²¢ÔÚNPMÖÐÉèÖÃÏìÓ¦µÄÊðÀíÉèÖà £¬¼´¿ÉʵÏÖ»ùÓÚNPMµÄÁ÷Á¿¸ôÀë¡£

×ܽá

ͨ¹ýʹÓÃNginx Proxy Manager £¬ÎÒÃÇ¿ÉÒÔ¹¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ £¬ÊµÏÖ¶ÔÈÝÆ÷ЧÀ͵ÄÁ÷Á¿¸ôÀë¡£NPMÌṩÁËÓû§ÓѺõĽçÃæ £¬Ê¹µÃÉèÖúÍÖÎÀíÈÝÆ÷ЧÀͱäµÃ¼òÆÓÒ×Óá£Í¬Ê± £¬Í¨¹ýSSLÖ¤ÊéµÄÉèÖà £¬ÎÒÃÇ¿ÉÒÔ°ü¹ÜÊý¾Ý´«ÊäµÄÇå¾²ÐÔ¡£

ÒÔÉÏÊǹØÓÚÔõÑùʹÓÃNginx Proxy ManagerʵÏÖÁ÷Á¿¸ôÀëµÄÏÈÈݺʹúÂëʾÀý¡£Ï£Íû±¾ÎÄÄܹ»×ÊÖúµ½Äã¹¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ¡£

ÒÔÉϾÍÊǹ¹½¨Çå¾²¿É¿¿µÄÈÝÆ÷ЧÀÍ£ºÊ¹ÓÃNginx Proxy ManagerʵÏÖÁ÷Á¿¸ôÀëµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

13452372176

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

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

QR code
ÍøÕ¾µØͼ