×ðÁú¿­Ê±

Nginx Proxy ManagerÉèÖÃÆÊÎöÓëÓÅ»¯

Nginx Proxy ManagerÉèÖÃÆÊÎöÓëÓÅ»¯

¸ÅÊö£º

Nginx Proxy ManagerÊÇÒ»¸ö»ùÓÚNginxµÄ·´ÏòÊðÀíÖÎÀí¹¤¾ß £¬¿ÉÒÔ×ÊÖúÎÒÃÇÀû±ãµØÉèÖúÍÖÎÀí·´ÏòÊðÀíЧÀÍÆ÷ ¡£ÔÚʹÓÃNginx Proxy ManagerµÄÀú³ÌÖÐ £¬ÎÒÃÇ¿ÉÒÔͨ¹ý¶ÔÆäÉèÖþÙÐÐÆÊÎöÓëÓÅ»¯ £¬Ìá¸ßЧÀÍÆ÷µÄÐÔÄÜÓëÇå¾²ÐÔ ¡£

ÉèÖÃÆÊÎö£º

ÉèÖÃÎļþλÖúͽṹ£º

Nginx Proxy ManagerµÄÉèÖÃÎļþλÓÚ/etc/nginx/conf.dĿ¼Ï £¬Ã¿¸ö·´ÏòÊðÀíµÄÉèÖÃÎļþÒÔ.conf×îºó ¡£ÔÚÉèÖÃÎļþÖÐ £¬Ö÷Òª°üÀ¨ÁËÊðÀíЧÀÍÆ÷µÄIPµØµã¡¢¶Ë¿ÚºÅ¡¢ÓòÃûµÈÐÅÏ¢ ¡£

»ù±¾ÉèÖÃÏîÆÊÎö£º

ÔÚÉèÖÃÎļþÖÐ £¬ÎÒÃÇ¿ÉÒÔ¿´µ½Ò»Ð©»ù±¾µÄÉèÖÃÏî £¬ÈçÏÂËùʾ£º

server {

listen 80;
server_name example.com;

location / {
    proxy_pass http://backend;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
}

µÇ¼ºó¸´ÖÆ

}

ÆäÖÐ £¬listenÖ¸¶¨¼àÌýµÄ¶Ë¿ÚºÅ £»server_nameÖ¸¶¨ÓòÃû £»locationÖ¸¶¨URL·¾¶ £»proxy_passÖ¸¶¨×ª·¢µ½µÄºó¶ËЧÀÍÆ÷µØµã £»proxy_set_headerÖ¸¶¨ÉèÖÃÇëÇóÍ·ÐÅÏ¢ ¡£

¸ß¼¶ÉèÖÃÏîÆÊÎö£º

ÔÚNginx Proxy ManagerµÄÉèÖÃÎļþÖÐ £¬Ò²Ö§³ÖһЩ¸ß¼¶µÄÉèÖÃÏî £¬À´ÓÅ»¯Ð§ÀÍÆ÷µÄÐÔÄܺÍÇå¾²ÐÔ ¡£ÒÔÏÂΪһЩ³£¼ûµÄ¸ß¼¶ÉèÖÃÏ

keepalive_timeout£ºÉèÖÃÓëºó¶ËЧÀÍÆ÷µÄÅþÁ¬µÄ¼á³Öʱ¼ä £¬Ä¬ÒÔΪ75s ¡£¿ÉÒÔÊʵ±µ÷½â¸ÃÖµÀ´Ìá¸ßÐÔÄÜ ¡£

worker_connections£ºÉèÖÃÿ¸öÊÂÇéÀú³ÌµÄ×î´óÅþÁ¬Êý £¬Ä¬ÒÔΪ1024 ¡£¿ÉÒÔÊʵ±µ÷½â¸ÃÖµÀ´Ìá¸ßÐÔÄÜ ¡£

client_max_body_size£ºÉèÖÃÎüÊÕ¿Í»§¶ËÇëÇóµÄ×î¸ÅÂÔ»ý £¬Ä¬ÒÔΪ1m ¡£¿ÉÒÔƾ֤ÏÖʵÐèÇóÀ´ÉèÖýϴóµÄÖµ £¬ÒÔÖ§³Ö´óÎļþµÄÉÏ´« ¡£

limit_req_zone£ºÉèÖÃÏÞÖÆÇëÇóµÄËÙÂʺÍÅþÁ¬Êý £¬ÒÔ±ÜÃâ¶ñÒâÇëÇóºÍDDoS¹¥»÷ ¡£

SSL/TLSÉèÖãº

Nginx Proxy Manager»¹Ö§³ÖSSL/TLSµÄÉèÖà £¬ÒÔÌṩÇå¾²µÄͨѶ ¡£ÒÔÏÂÊÇһЩ³£¼ûµÄSSL/TLSÉèÖÃÏ

server {

listen 443 ssl;
server_name example.com;

ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/cert.key;

location / {
    proxy_pass http://backend;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
}

µÇ¼ºó¸´ÖÆ

}

ÆäÖÐ £¬ssl_certificateºÍssl_certificate_keyÖ¸¶¨SSLÖ¤ÊéµÄ·¾¶ ¡£Í¨¹ýÉèÖÃSSL/TLS £¬ÎÒÃÇ¿ÉÒÔ± £»¤¿Í»§¶ËÓëÊðÀíЧÀÍÆ÷Ö®¼äµÄÊý¾Ý´«ÊäÇå¾² ¡£

ÉèÖÃÓÅ»¯£º

ΪÁ˽øÒ»²½Ìá¸ßNginx Proxy ManagerµÄÐÔÄܺÍÇå¾²ÐÔ £¬ÎÒÃÇ¿ÉÒÔ¾ÙÐÐһЩÓÅ»¯ÉèÖà ¡£

»º´æÉèÖãº

Nginx Proxy ManagerÖ§³ÖHTTP»º´æÉèÖà £¬¿ÉÒÔ½«¾­³£»á¼ûµÄ¾²Ì¬×ÊÔ´»º±£´æÍâµØ £¬ÒÔïÔÌ­ÏìӦʱ¼äºÍ´ø¿íÕ¼Óà ¡£ÒÔÏÂÊÇһЩ³£¼ûµÄ»º´æÉèÖÃÏ

server {

listen 80;
server_name example.com;

location / {
    proxy_pass http://backend;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_cache my_cache;
    proxy_cache_valid 200 1h;
}

location ~* .(css|js|gif|jpg|jpeg|png)$ {
    proxy_cache my_cache;
    proxy_cache_valid 200 1d;
}

location ~* .(woff|ttf|svg|eot)$ {
    proxy_pass http://backend;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_cache my_cache;
    proxy_cache_valid 200 30d;
}

µÇ¼ºó¸´ÖÆ

}

ÆäÖÐ £¬proxy_cacheÖ¸¶¨»º´æÃû³Æ £¬proxy_cache_validÖ¸¶¨»º´æµÄÓÐÓÃʱ¼ä ¡£

¸ºÔØƽºâÉèÖãº

ΪÁËÌá¸ßЧÀÍÆ÷µÄÐÔÄܺͿÉÓÃÐÔ £¬ÎÒÃÇ¿ÉÒÔʹÓÃNginx Proxy ManagerµÄ¸ºÔØƽºâ¹¦Ð§ £¬½«ÇëÇó·Ö·¢µ½¶à¸öºó¶ËЧÀÍÆ÷ÉÏ ¡£ÒÔÏÂÊÇһЩ³£¼ûµÄ¸ºÔØƽºâÉèÖÃÏ

upstream backend {

server backend1.example.com;
server backend2.example.com;
server backend3.example.com;

µÇ¼ºó¸´ÖÆ

}

ÆäÖÐ £¬backend1¡¢backend2ºÍbackend3Ϊºó¶ËЧÀÍÆ÷µÄµØµã ¡£

Çå¾²ÉèÖãº

ΪÁËÌá¸ßЧÀÍÆ÷µÄÇå¾²ÐÔ £¬ÎÒÃÇ¿ÉÒÔʹÓÃNginx Proxy ManagerµÄÇå¾²ÉèÖÃÏî £¬ÈçÒÔÏÂËùʾ£º

server {

listen 80;
server_name example.com;

location / {
    proxy_pass http://backend;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_hide_header X-Powered-By;
    proxy_hide_header Server;
    proxy_next_upstream error timeout http_503;
}

µÇ¼ºó¸´ÖÆ

}

ÆäÖÐ £¬proxy_set_headerÖ¸¶¨ÇëÇóÍ·ÐÅÏ¢ £¬proxy_hide_headerÖ¸¶¨Òþ²ØµÄÏìӦͷÐÅÏ¢ £¬proxy_next_upstreamÖ¸¶¨ÔÚÓöµ½¹ýʧ¡¢³¬Ê±»òhttp_503ʱ £¬¼ÌÐøÏòÏÂÒ»¸öºó¶ËЧÀÍÆ÷ת·¢ÇëÇó ¡£

½áÓ

ͨ¹ý¶ÔNginx Proxy ManagerµÄÉèÖþÙÐÐÆÊÎöÓëÓÅ»¯ £¬ÎÒÃÇ¿ÉÒÔÌá¸ßЧÀÍÆ÷µÄÐÔÄܺÍÇå¾²ÐÔ ¡£ÔÚÏÖʵӦÓÃÖÐ £¬¿ÉÒÔƾ֤ÐèÇó¾ÙÐÐÊʵ±µÄÉèÖõ÷½â £¬²¢ÔÚ²âÊÔÇéÐÎÖоÙÐвâÊÔºÍÑéÖ¤ ¡£Ï£Íû±¾ÆªÎÄÕÂÄܹ»¶Ô¸÷ÈËÔÚʹÓÃNginx Proxy ManagerʱÓÐËù×ÊÖú ¡£

ÒÔÉϾÍÊÇNginx Proxy ManagerÉèÖÃÆÊÎöÓëÓÅ»¯µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

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