×ðÁú¿­Ê±

Nginx»á¼ûÏÞÖÆÉèÖà £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´²»±»Ð¹Â¶

nginx»á¼ûÏÞÖÆÉèÖà £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´²»±»Ð¹Â¶

Ëæ×ÅÍøÂçµÄÉú³¤ £¬Ô½À´Ô½¶àµÄÍøÕ¾±äµÃºÜÊÇÖ÷ÒªºÍÃô¸Ð¡£ÕâЩÍøÕ¾¿ÉÄÜ°üÀ¨Óû§µÄСÎÒ˽¼ÒÐÅÏ¢¡¢ÉÌÒµÉñÃØ»òÆäËûÃô¸ÐÊý¾Ý¡£ÎªÁ˱£»¤ÕâЩ×ÊÔ´²»±»Ð¹Â¶»ò±»Î´¾­ÊÚȨµÄ»á¼û £¬ÎÒÃÇÐèÒª¶ÔÍøÕ¾¾ÙÐÐÑÏ¿áµÄ»á¼ûÏÞÖÆÉèÖá£ÔÚ±¾ÎÄÖÐ £¬ÎÒ½«ÏÈÈÝÔõÑùʹÓÃNginxÉèÖÃÀ´ÏÞÖÆ»á¼û £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´¡£

NginxÊÇÒ»¸ö¸ßÐÔÄܵÄWebЧÀÍÆ÷ºÍ·´ÏòÊðÀíЧÀÍÆ÷ £¬Í¬Ê±Ò²ÊÇÒ»¸öºÜÊÇÎÞаºÍ¿ÉÀ©Õ¹µÄ¹¤¾ß¡£ËüÌṩÁ˶àÖÖÒªÁìÀ´ÏÞÖÆ»á¼û £¬°üÀ¨»ùÓÚIPµØµãµÄ»á¼û¿ØÖÆ¡¢»ùÓÚHTTPÒªÁìµÄÏÞÖÆ¡¢»ùÓÚÓû§ºÍÃÜÂëµÄÈÏÖ¤µÈ¡£ÏÂÃæÊÇһЩ³£¼ûµÄ»á¼ûÏÞÖÆÉèÖÃʾÀý£º

»ùÓÚIPµØµãµÄ»á¼û¿ØÖÆ

¿ÉÒÔʹÓÃNginxµÄ¡°allow¡±ºÍ¡°deny¡±Ö¸ÁîÀ´ÊµÏÖ»ùÓÚIPµØµãµÄ»á¼û¿ØÖÆ¡£ÀýÈç £¬ÏÂÃæµÄÉèÖý«Ö»ÔÊÐíÌض¨IPµØµãµÄÇëÇó»á¼ûÍøÕ¾×ÊÔ´ £¬ÆäËûIPµØµãµÄÇëÇ󽫱»¾Ü¾ø£º

location / {
    deny all;
    allow 192.168.0.1;
}

µÇ¼ºó¸´ÖÆ

ÉÏÊöÉèÖÃÖÐ £¬¡°deny all¡±ÌåÏÖ¶ÔËùÓÐÇëÇó¾ÙÐоܾø £¬¶ø¡°allow 192.168.0.1¡±ÌåÏÖÖ»ÔÊÐíIPµØµãΪ192.168.0.1µÄÇëÇóͨ¹ý¡£

»ùÓÚHTTPÒªÁìµÄÏÞÖÆ

ÓÐʱ¼ä £¬ÎÒÃÇÏ£ÍûÖ»ÔÊÐíÌض¨µÄHTTPÒªÁ죨ÈçGET¡¢POST£©À´»á¼ûÍøÕ¾×ÊÔ´¡£NginxÌṩÁË¡°limit_except¡±Ö¸ÁîÀ´ÊµÏÖÕâ¸ö¹¦Ð§¡£ÏÂÃæµÄÉèÖÃʾÀý½«Ö»ÔÊÐíGETºÍPOSTÇëÇó»á¼ûÍøÕ¾×ÊÔ´ £¬ÆäËûHTTPÒªÁìµÄÇëÇ󽫱»¾Ü¾ø£º

location / {
    limit_except GET POST {
        deny all;
    }
}

µÇ¼ºó¸´ÖÆ

ÉÏÊöÉèÖÃÖÐ £¬¡°limit_except GET POST¡±ÌåÏÖÖ»ÔÊÐíGETºÍPOSTÇëÇóͨ¹ý £¬ÆäËûHTTPÒªÁìµÄÇëÇ󽫱»¾Ü¾ø¡£

»ùÓÚÓû§ºÍÃÜÂëµÄÈÏÖ¤

ÓÐʱ¼ä £¬ÎÒÃÇÏ£ÍûÖ»ÔÊÐí¾­ÓÉÉí·ÝÈÏÖ¤µÄÓû§²Å»ª»á¼ûÍøÕ¾×ÊÔ´¡£NginxÌṩÁË»ùÓÚÓû§ºÍÃÜÂëµÄÈÏÖ¤¹¦Ð§¡£ÏÂÃæµÄÉèÖÃʾÀý½«Ö»ÔÊÐí¾­ÓÉÓû§ÃûºÍÃÜÂëÈÏÖ¤µÄÓû§»á¼ûÍøÕ¾×ÊÔ´£º

location / {
    auth_basic "Restricted Access";
    auth_basic_user_file /path/to/htpasswd;
}

µÇ¼ºó¸´ÖÆ

ÉÏÊöÉèÖÃÖÐ £¬¡°auth_basic “Restricted Access”¡±ÌåÏÖ¶ÔÇëÇó¾ÙÐÐÉí·ÝÈÏÖ¤ £¬²¢ÏÔʾ¡°Restricted Access¡±µÄÌáÐÑÐÅÏ¢¡£¶ø¡°auth_basic_user_file /path/to/htpasswd¡±ÌåÏÖÖ¸¶¨Óû§ÃûºÍÃÜÂëµÄ´æ´¢Îļþ·¾¶¡£

ͨ¹ýÒÔÉÏʾÀý £¬ÎÒÃÇ¿ÉÒÔƾ֤ÐèÒªÎÞаµØÉèÖÃNginxµÄ»á¼ûÏÞÖÆ £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´²»±»Ð¹Â¶¡£ËäÈ» £¬³ýÁËÉÏÊöÒªÁìÍâ £¬Nginx»¹ÌṩÁËÆäËûÐí¶àÇ¿Ê¢µÄ»á¼ûÏÞÖÆÉèÖÃÑ¡Ïî £¬¿ÉÒÔƾ֤ÏêϸÐèÇó¾ÙÐÐÑ¡ÔñºÍ×éºÏʹÓá£

×ܽáÆðÀ´ £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´²»±»Ð¹Â¶ÊÇÿ¸öÍøÕ¾ÖÎÀíÔ±µÄÔðÈΡ£Í¨¹ýºÏÀíÉèÖÃNginxµÄ»á¼ûÏÞÖÆ £¬ÎÒÃÇ¿ÉÒÔÌṩÌØÁíÍâ±£»¤²ã £¬ÔöÇ¿ÍøÕ¾µÄÇå¾²ÐÔ¡£ÔÚÉèÖÃÉèÖÃʱ £¬ÇëÎñ±Ø˼Á¿µ½ÏÖʵÐèÇóºÍÇå¾²ÐÔ £¬×èÖ¹Îó²Ù×÷»òÉèÖùýʧµ¼Ö»á¼ûÕÏ°­»òй¶Ãô¸Ð×ÊÔ´¡£Ï£Íû±¾ÎÄÄܹ»Îª¶ÁÕßÌṩÓÐÓõIJο¼ºÍÖ¸µ¼ £¬×ÊÖúËûÃǸüºÃµØ±£»¤ÍøÕ¾×ÊÔ´¡£

ÒÔÉϾÍÊÇNginx»á¼ûÏÞÖÆÉèÖà £¬±£»¤Ãô¸ÐÍøÕ¾×ÊÔ´²»±»Ð¹Â¶µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

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