Nginx Proxy ManagerÓëDockerµÄÍêÉÆÍŽ᣺¿ìËٴÈÝÆ÷»¯Ó¦ÓÃ
Nginx Proxy ManagerÓëDockerµÄÍêÉÆÍŽ᣺¿ìËٴÈÝÆ÷»¯Ó¦ÓÃ
Ëæ×ÅÔÆÅÌËãºÍÈÝÆ÷»¯ÊÖÒյĿìËÙÉú³¤£¬Ô½À´Ô½¶àµÄ¿ª·¢ÕߺÍÆóÒµ½«Ó¦ÓóÌÐò°²Åŵ½ÈÝÆ÷ÖС£Docker×÷ΪÏÖÔÚ×îÊ¢ÐеÄÈÝÆ÷»¯Æ½Ì¨Ö®Ò»£¬ÎªÓ¦ÓóÌÐòµÄ°²ÅÅ¡¢ÖÎÀíºÍÀ©Õ¹ÌṩÁ˱㵱¡£¶øNginx Proxy Manager×÷ΪһÖÖ»ùÓÚNginxµÄ·´ÏòÊðÀí¹¤¾ß£¬¿ÉÒÔ×ÊÖúÎÒÃÇͨ¹ý¼òÆÓµÄÉèÖÃʵÏÖÓ¦ÓóÌÐòµÄ¸ºÔØƽºâ¡¢ÊðÀíºÍÐéÄâÖ÷»úÉèÖᣱ¾ÎĽ«ÏÈÈÝNginx Proxy ManagerÓëDockerµÄÍêÉÆÍŽᣬÒÔʵÏÖ¿ìËٴÈÝÆ÷»¯Ó¦ÓõÄÄ¿µÄ£¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£
Ò»¡¢Nginx Proxy Manager¼ò½é
Nginx Proxy ManagerÊÇ»ùÓÚNginxµÄ¿ªÔ´ÏîÄ¿£¬Ö¼ÔÚ×ÊÖúÓû§Í¨¹ý¼òÆÓµÄͼÐλ¯½çÃæ½çÃæÉèÖÃNginxµÄ·´ÏòÊðÀíºÍÐéÄâÖ÷»ú¡£ËüÖ§³ÖHTTPºÍHTTPSÐÒ飬¿ÉÒÔÉèÖöà¸öÓ¦ÓóÌÐòµÄÊðÀíºÍ¸ºÔØƽºâ¡£Í¨¹ýNginx Proxy Manager£¬ÎÒÃÇ¿ÉÒÔÇáËÉÖÎÀí¶à¸öÓòÃûºÍ×ÓÓòÃû£¬ÊµÏÖ¶ÔÓ¦ÓóÌÐòµÄÁéÉú·Óɺ͸ºÔØƽºâ¡£
¶þ¡¢Docker¼ò½é
DockerÊÇÒ»ÖÖ¿ªÔ´µÄÈÝÆ÷»¯Æ½Ì¨£¬¿ÉÒÔ½«Ó¦ÓóÌÐòºÍÆäÒÀÀµµÄÈí¼þ´ò°üµ½Ò»¸öÈÝÆ÷ÖУ¬ÐγÉÒ»¸ö×ÔÁ¦¡¢¿ÉÒÆÖ²µÄÓ¦ÓóÌÐò¡£Í¨¹ýDocker£¬ÎÒÃÇ¿ÉÒÔ¿ìËÙ¡¢Ò»Öµذ²ÅÅÓ¦ÓóÌÐò£¬²¢ÊµÏÖ¿ª·¢ÇéÐκÍÉú²úÇéÐεÄÎÞ·ìת»»¡£DockerµÄ½¹µã¿´·¨°üÀ¨¾µÏñ¡¢ÈÝÆ÷¡¢¿ÍÕ»ºÍÍøÂçµÈ¡£
Èý¡¢Nginx Proxy ManagerÓëDockerµÄÍŽá
Nginx Proxy ManagerÓëDockerµÄÍŽáʹÓÃÁËDockerµÄÈÝÆ÷»¯ÌØÕ÷£¬Ê¹µÃÎÒÃÇ¿ÉÒÔ¿ìËٴºÍÖÎÀíÓ¦ÓóÌÐòµÄ·´ÏòÊðÀí¡£ÏÂÃæÊÇÒ»¸öÏêϸµÄʾÀý£¬ÒÔÑÝʾÔõÑùʹÓÃNginx Proxy ManagerºÍDocker´î½¨Ò»¸ö»ùÓÚWebµÄÓ¦ÓóÌÐò£º
×°ÖÃDockerºÍDocker Compose
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚÖ÷»úÉÏ×°ÖÃDockerºÍDocker Compose¡£ÏêϸװÖð취¿ÉÒԲο¼Docker¹Ù·½Îĵµ¡£
½¨ÉèÒ»¸öDocker ComposeÎļþ
ÔÚÏîÄ¿µÄ¸ùĿ¼Ï½¨ÉèÒ»¸öÃûΪdocker-compose.ymlµÄÎļþ£¬²¢Ìí¼ÓÒÔÏÂÄÚÈÝ£º
version: "3" services: nginx-proxy: image: jwilder/nginx-proxy restart: always ports: - "80:80" - "443:443" volumes: - "/var/run/docker.sock:/tmp/docker.sock:ro" nginx-proxy-manager: image: jlesage/nginx-proxy-manager restart: always ports: - "81:81" - "444:444" environment: - "DB_SQLITE_FILE=/data/database.sqlite" - "DATA_PATH=/data" app: image: your-app-image restart: always environment: - "VIRTUAL_HOST=your-domain.com"
µÇ¼ºó¸´ÖÆ
ÉÏÊöÉèÖÃÎļþ½ç˵ÁËÈý¸öЧÀÍ£ºnginx-proxyÓÃÓÚ´¦ÀíHTTPºÍHTTPSÇëÇóµÄ·´ÏòÊðÀíЧÀÍ£¬nginx-proxy-managerÓÃÓÚÖÎÀíNginxÊðÀíµÄͼÐλ¯½çÃæЧÀÍ£¬appΪÎÒÃÇ×Ô¼ºµÄÓ¦ÓóÌÐòЧÀÍ¡£
Æô¶¯DockerÈÝÆ÷
ÔËÐÐÒÔÏÂÏÂÁÆô¶¯DockerÈÝÆ÷£º
docker-compose up -d
µÇ¼ºó¸´ÖÆ
ÉèÖÃNginx Proxy Manager
ÔÚä¯ÀÀÆ÷Öлá¼ûhttp://your-host-name:81£¬½øÈëNginx Proxy ManagerµÄͼÐλ¯½çÃæ¡£ÔÚ½çÃæÖÐÌí¼ÓÒ»¸öеÄÊðÀíÖ÷»ú£¨Proxy Hosts£©£¬²¢ÉèÖöÔÓ¦µÄÓòÃûºÍºó¶ËЧÀÍ¡£ÕâÑù£¬Nginx Proxy Manager½«»á½«ÇëÇóת·¢µ½ÎÒÃǵÄÓ¦ÓóÌÐòЧÀÍ¡£
ÒÔÉÏʾÀýÑÝʾÁËÔõÑùʹÓÃNginx Proxy ManagerºÍDocker¿ìËٴÈÝÆ÷»¯Ó¦Óá£Í¨¹ýNginx Proxy ManagerµÄͼÐλ¯½çÃ棬ÎÒÃÇ¿ÉÒÔÀû±ãµØÉèÖ÷´ÏòÊðÀíºÍÐéÄâÖ÷»ú£¬²¢ÊµÏÖÓ¦ÓóÌÐòµÄÁéÉú·Óɺ͸ºÔØƽºâ¡£
×ܽá
Nginx Proxy ManagerÓëDockerµÄÍŽᣬΪÎÒÃÇÌṩÁËÒ»ÖÖ¿ìËٴÈÝÆ÷»¯Ó¦Óõļƻ®¡£Í¨¹ý¼òÆÓµÄÉèÖúͽçÃæ²Ù×÷£¬ÎÒÃÇ¿ÉÒÔÇáËɵØʵÏÖ·´ÏòÊðÀíºÍÐéÄâÖ÷»úÉèÖá£Í¬Ê±£¬Ê¹ÓÃDockerµÄÈÝÆ÷»¯ÌØÕ÷£¬ÎÒÃÇ¿ÉÒÔʵÏÖÓ¦ÓóÌÐòµÄ¿ìËÙ°²ÅźÍÀ©Õ¹¡£ÒÔÉÏʾÀýÌṩÁËÒ»¸öÏêϸµÄʹÓó¡¾°£¬²¢ÌṩÁËÏìÓ¦µÄ´úÂëʾÀý£¬Ï£ÍûÄܹ»×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·ºÍÓ¦ÓÃNginx Proxy ManagerÓëDockerµÄÍêÉÆÍŽᡣ
ÒÔÉϾÍÊÇNginx Proxy ManagerÓëDockerµÄÍêÉÆÍŽ᣺¿ìËٴÈÝÆ÷»¯Ó¦ÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡