Nginx Proxy ManagerʵÏֶ༶»º´æµÄ°²ÅÅÓëÉèÖÃ
Nginx Proxy ManagerÊÇÒ»¿î¿ªÔ´µÄ·´ÏòÊðÀíЧÀÍÆ÷£¬¿ÉÒÔʵÏֶ༶»º´æµÄ°²ÅÅÓëÉèÖá£Í¨¹ýºÏÀíÉèÖ㬿ÉÒÔÌá¸ßÍøÕ¾µÄÐÔÄܺͻá¼ûËÙÂÊ¡£
Ò»¡¢×°ÖÃNginx Proxy Manager
Ê×ÏÈ£¬ÎÒÃÇÐèҪװÖÃNginx Proxy Manager¡£¿ÉÒÔͨ¹ýÒÔÏ°취¾ÙÐÐ×°Öãº
¸üÐÂϵͳÈí¼þ°ü£ºsudo apt update
×°ÖÃNginx£ºsudo apt install nginx
×°ÖÃNode.jsºÍnpm£ºsudo apt install nodejs npm
ÏÂÔز¢×°ÖÃNginx Proxy Manager£ºgit clone https://github.com/jc21/nginx-proxy-manager.git
cd nginx-proxy-manager
npm install
npm run db:seed
¶þ¡¢ÉèÖÃNginx Proxy Manager
ÐÞ¸ÄÉèÖÃÎļþ
·¿ªNginx Proxy ManagerµÄÉèÖÃÎļþ£ºsudo nano /etc/nginx/sites-available/default
ÔÚÎļþµÄserver²¿·ÖÌí¼ÓÒÔÏÂÉèÖãº
location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
µÇ¼ºó¸´ÖÆ
½«ÉÏÊöÉèÖÃÖеÄ127.0.0.1:8080¸ÄΪÄúÏÖʵʹÓõÄÉÏÓÎЧÀÍÆ÷µØµãºÍ¶Ë¿Ú¡£
ÉèÖûº´æ
·¿ªNginx Proxy ManagerµÄ»º´æÉèÖÃÎļþ£ºsudo nano /etc/nginx/nginx.conf
ÔÚhttp²¿·ÖÌí¼ÓÒÔÏÂÉèÖãº
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m; proxy_cache_key "$scheme$request_method$host$request_uri"; proxy_cache_valid any 10m; server { ... location / { proxy_cache my_cache; proxy_cache_valid 200 301 302 10m; proxy_cache_valid any 10s; proxy_cache_min_uses 1; proxy_cache_background_update on; proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; proxy_cache_lock on; proxy_cache_lock_timeout 5s; proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } ... }
µÇ¼ºó¸´ÖÆ
½«ÉÏÊöÉèÖÃÖеÄ/path/to/cacheÌ滻ΪÄúÏÖʵϣÍû´æ´¢»º´æµÄ·¾¶¡£
Èý¡¢²âÊÔÓëЧ¹û
ÖØÐÂÆô¶¯Nginx£ºsudo systemctl restart nginx
ÏÖÔÚ£¬Äú¿ÉÒÔͨ¹ýä¯ÀÀÆ÷»á¼ûЧÀÍÆ÷µÄ¹«¹²IPµØµã£¬½«ÇëÇóת´ïµ½ÉÏÓÎЧÀÍÆ÷²¢»º´æÏìÓ¦¡£ÕâÑù£¬µ±¶à¸öÓû§ÇëÇóÏàͬµÄ×ÊԴʱ£¬Nginx Proxy Manager½«Ö±½Ó´Ó»º´æÖÐÌṩÏìÓ¦£¬¶ø²»ÊÇÖØÐÂÇëÇóÉÏÓÎЧÀÍÆ÷¡£
ËÄ¡¢ÊµÏֶ༶»º´æ
ÈôÊÇÄúµÄ¼Ü¹¹ÐèÒª¸ü¸ß¼¶±ðµÄ»º´æ£¬Äú¿ÉÒÔÉèÖöà¸öNginx Proxy ManagerʵÀý£¬²¢½«ËüÃÇÅþÁ¬ÆðÀ´¡£
ÀýÈ磬Äú¿ÉÒÔÉèÖÃÒ»¸öNginx Proxy ManagerʵÀý×÷ΪǰÖûº´æЧÀÍÆ÷£¬½«ÇëÇóת·¢µ½ÁíÒ»¸öNginx Proxy ManagerʵÀý£¬ºóÕß×÷ΪÉÏÓÎЧÀÍÆ÷¡£ÕâÑù£¬Ç°Öûº´æЧÀÍÆ÷½«»º´æ´ÓÉÏÓÎЧÀÍÆ÷ÇëÇóµÄÏìÓ¦£¬²¢ÔÚºóÐøÇëÇóʱֱ½Ó´Ó»º´æÖÐÌṩÏìÓ¦¡£Ö»Óе±»º´æδÖÀÖÐʱ£¬Ç°Öûº´æЧÀÍÆ÷²Å»áÇëÇóÉÏÓÎЧÀÍÆ÷¡£
ÉèÖö༶»º´æµÄÒªÁìÓëÉèÖõ¥¸ö»º´æÏàËÆ£¬Ö»Ð轫ǰÖûº´æЧÀÍÆ÷µÄµØµãºÍ¶Ë¿ÚÉèÖÃΪÉÏÓÎЧÀÍÆ÷µÄµØµãºÍ¶Ë¿Ú¼´¿É¡£
Îå¡¢×ܽá
ͨ¹ýNginx Proxy Manager£¬ÎÒÃÇ¿ÉÒÔÇáËÉʵÏֶ༶»º´æµÄ°²ÅÅÓëÉèÖ᣺ÏÀíÉèÖûº´æ¿ÉÒÔÓÐÓÃÌá¸ßÍøÕ¾µÄÐÔÄܺͻá¼ûËÙÂÊ£¬¼õÇáÉÏÓÎЧÀÍÆ÷µÄ¸ºÔØ¡£Ï£ÍûÒÔÉÏÄÚÈݶÔÄúÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇNginx Proxy ManagerʵÏֶ༶»º´æµÄ°²ÅÅÓëÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡