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

Nginx Proxy ManagerϵÄÈÝÆ÷Óë΢ЧÀ͵ݲÅÅÕ½ÂÔ

Nginx Proxy ManagerϵÄÈÝÆ÷Óë΢ЧÀ͵ݲÅÅÕ½ÂÔ £¬ÐèÒªÏêϸ´úÂëʾÀý

ͻ񻣼

Ëæ×Å΢ЧÀͼܹ¹µÄÊ¢ÐÐ £¬ÈÝÆ÷»¯ÊÖÒÕ³ÉΪÁËÏÖ´úÈí¼þ¿ª·¢µÄÖ÷Òª×é³É²¿·Ö¡£¶øÔÚ΢ЧÀͼܹ¹ÖÐ £¬Nginx Proxy ManagerÊÎÑÝןÜÖ÷ÒªµÄ½ÇÉ« £¬ÓÃÓÚÖÎÀíºÍÊðÀí΢ЧÀ͵ÄÁ÷Á¿¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃNginx Proxy ManagerÀ´°²ÅźÍÖÎÀíÈÝÆ÷»¯µÄ΢ЧÀÍ £¬²¢ÌṩÏà¹ØµÄ´úÂëʾÀý¡£

СÐò

΢ЧÀͼܹ¹½«Ò»¸ö´óÐÍÓ¦Óòð·Ö³É¶à¸ö×ÔÁ¦µÄСÐÍЧÀÍ £¬Ã¿¸öЧÀͶ¼¿ÉÒÔ×ÔÁ¦°²ÅźÍά»¤¡£ÈÝÆ÷»¯ÊÖÒÕ£¨ÈçDocker£©ÔòÌṩÁËÒ»ÖÖÀû±ã¡¢¿ìËÙ¡¢¿ÉÒÆÖ²µÄ°²ÅÅ·½·¨ £¬Ê¹µÃ΢ЧÀͼܹ¹Ô½·¢ÎÞаºÍ¿ÉÀ©Õ¹¡£

Nginx Proxy Manager¼ò½é

Nginx Proxy ManagerÊÇÒ»¸ö»ùÓÚNginxµÄ·´ÏòÊðÀíÖÎÀí¹¤¾ß £¬ËüÌṩÁËÒ»¸öÓû§ÓѺõÄWeb½çÃæ £¬¿ÉÒÔÀû±ãµØÉèÖúÍÖÎÀí¶à¸öNginx·´ÏòÊðÀíЧÀÍÆ÷¡£ÔÚ΢ЧÀͼܹ¹ÖÐ £¬Nginx Proxy Manager¿ÉÒÔ±»ÓÃÀ´ÊðÀí²î±ðµÄ΢ЧÀÍ £¬²¢ÖÎÀíËüÃÇÖ®¼äµÄ·Óɺ͸ºÔØƽºâ¡£

ʹÓÃNginx Proxy Manager°²ÅÅ΢ЧÀÍ

ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄʾÀý £¬ÑÝʾÔõÑùʹÓÃNginx Proxy ManagerÀ´°²ÅÅÁ½¸öÈÝÆ÷»¯µÄ΢ЧÀÍ£ºÒ»¸öÇ°¶ËЧÀͺÍÒ»¸öºó¶ËЧÀÍ¡£

Ê×ÏÈ £¬ÎÒÃÇÐèÒª½¨ÉèÁ½¸öDockerÈÝÆ÷ £¬Ò»¸öÓÃÓÚÔËÐÐÇ°¶ËЧÀÍ £¬Ò»¸öÓÃÓÚÔËÐкó¶ËЧÀÍ¡£¼ÙÉèÎÒÃÇÒѾ­ÔÚËÞÖ÷»úÉÏ×°ÖÃÁËDocker¡£

3.1 Ç°¶ËЧÀÍÈÝÆ÷

½¨ÉèÒ»¸öÃûΪ”frontend”µÄĿ¼ £¬²¢ÔÚ¸ÃĿ¼Ï½¨ÉèÒ»¸öÃûΪ”Dockerfile”µÄÎļþ¡£ÔÚDockerfileÖÐ £¬ÎÒÃǽç˵ÁËÇ°¶ËЧÀÍËùÐèµÄÇéÐκÍÒÀÀµ £¬²¢½«Ç°¶Ë´úÂ븴ÖƵ½ÈÝÆ÷ÄÚ¡£

ʾÀýDockerfileÄÚÈÝÈçÏ£º

FROM nginx:1.17.9-alpine
COPY ./frontend /usr/share/nginx/html

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÔÚÏÂÁîÐÐÖÐÔËÐÐÒÔÏÂÏÂÁîÀ´¹¹½¨ºÍÔËÐÐÇ°¶ËЧÀÍÈÝÆ÷£º

docker build -t frontend:latest ./frontend
docker run -d --name frontend -p 8080:80 frontend:latest

µÇ¼ºó¸´ÖÆ

3.2 ºó¶ËЧÀÍÈÝÆ÷

½¨ÉèÒ»¸öÃûΪ”backend”µÄĿ¼ £¬²¢ÔÚ¸ÃĿ¼Ï½¨ÉèÒ»¸öÃûΪ”Dockerfile”µÄÎļþ¡£ÔÚDockerfileÖÐ £¬ÎÒÃǽç˵Á˺ó¶ËЧÀÍËùÐèµÄÇéÐκÍÒÀÀµ £¬²¢ÔËÐкó¶ËЧÀ͵ÄÆô¶¯ÏÂÁî¡£

ʾÀýDockerfileÄÚÈÝÈçÏ£º

FROM node:10-alpine
WORKDIR /app
COPY ./backend/package*.json ./
RUN npm install
COPY ./backend .
EXPOSE 3000
CMD [ "node", "index.js" ]

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÔÚÏÂÁîÐÐÖÐÔËÐÐÒÔÏÂÏÂÁîÀ´¹¹½¨ºÍÔËÐкó¶ËЧÀÍÈÝÆ÷£º

docker build -t backend:latest ./backend
docker run -d --name backend -p 3000:3000 backend:latest

µÇ¼ºó¸´ÖÆ

ÉèÖÃNginx Proxy Manager

ÔÚä¯ÀÀÆ÷Öз­¿ªNginx Proxy ManagerµÄWeb½çÃæ £¬µÇ¼²¢Ñ¡ÔñÄúÏëÒªÉèÖõÄÊðÀíЧÀÍÆ÷¡£½¨ÉèÁ½¸öеÄÖ÷»úÌõÄ¿ £¬½«Ç°¶ËЧÀ͵ÄÊðÀíÄ¿µÄÉèÖÃΪÈÝÆ÷»¯Ç°¶ËЧÀ͵ÄIPµØµãºÍ¶Ë¿Ú£¨ÀýÈ磺http://ÈÝÆ÷IPµØµã:8080£© £¬½«ºó¶ËЧÀ͵ÄÊðÀíÄ¿µÄÉèÖÃΪÈÝÆ÷»¯ºó¶ËЧÀ͵ÄIPµØµãºÍ¶Ë¿Ú£¨ÀýÈ磺http://ÈÝÆ÷IPµØµã:3000£©¡£

²âÊÔ΢ЧÀÍ°²ÅÅ

ÏÖÔÚ £¬ÔÚä¯ÀÀÆ÷Öлá¼ûNginx Proxy ManagerµÄÊðÀíЧÀÍÆ÷µØµã £¬Äú½«Äܹ»Í¨¹ýÊðÆÊÎö¼ûÇ°¶ËºÍºó¶ËЧÀÍ¡£ÀýÈç £¬Í¨¹ýhttp://ÊðÀíЧÀÍÆ÷µØµã/frontend¿ÉÒÔ»á¼ûÇ°¶ËЧÀÍ £¬Í¨¹ýhttp://ÊðÀíЧÀÍÆ÷µØµã/backend¿ÉÒÔ»á¼ûºó¶ËЧÀÍ¡£

½áÂÛ

±¾ÎÄÏÈÈÝÁËÔõÑùʹÓÃNginx Proxy ManagerÀ´°²ÅźÍÖÎÀíÈÝÆ÷»¯µÄ΢ЧÀÍ £¬²¢ÌṩÁËÏà¹ØµÄ´úÂëʾÀý¡£Í¨¹ýʹÓÃNginx Proxy Manager £¬¿ª·¢Ö°Ô±¿ÉÒÔÀû±ãµØÉèÖúÍÖÎÀí΢ЧÀÍÖ®¼äµÄ·Óɺ͸ºÔØƽºâ £¬´Ó¶øÌá¸ßÓ¦ÓõĿÉÉìËõÐԺͿÉά»¤ÐÔ¡£

È»¶ø £¬ÐèҪעÖصÄÊÇ £¬ÒÔÉÏʾÀý½öΪÁËÑÝʾĿµÄ £¬ÏÖÕæÏàÐοÉÄÜÔ½·¢ÖØ´ó¡£ÔÚÏÖʵ°²ÅÅÀú³ÌÖÐ £¬Äú¿ÉÄÜÐèÒª½øÒ»²½¶¨Öƺ͵÷½âÉèÖà £¬ÒÔÖª×ãÄúµÄÏêϸÐèÇó¡£

ÒÔÉϾÍÊÇNginx Proxy ManagerϵÄÈÝÆ÷Óë΢ЧÀ͵ݲÅÅÕ½ÂÔµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ