NGINX½ûÓûá¼ûdruid
Òª½ûÓÃ¶Ô druid µÄ nginx »á¼û£¬Ê×Ïȱ༠nginx ÉèÖÃÎļþ£¬ÕÒµ½ druid ЧÀÍÆ÷¿é²¢Ìí¼Ó server {} ¿é£¬ÆäÖаüÀ¨ return 403 Ö¸ÁîÒÔ·µ»Ø 403 ¹ýʧ£¬ÉúÑIJ¢ÖØмÓÔØ nginx£¬ÏÖÔÚ¶Ô druid µÄ nginx »á¼û½«±»½ûÓã¬ÈκÎʵÑé»á¼ûÇëÇ󶼽«ÊÕµ½ 403 ¹ýʧ¡£
ÔõÑù½ûÓÃ¶Ô Druid µÄ NGINX »á¼û
ÎÊÌ⣺ÔõÑù½ûÓÃ¶Ô Druid µÄ NGINX »á¼û£¿
»Ø¸²£ºÒª½ûÓÃ¶Ô Druid µÄ NGINX »á¼û£¬Çë×ñÕÕÒÔÏ°취£º
-
±à¼ NGINX ÉèÖÃÎļþ
ʹÓÃÎı¾±à¼Æ÷·¿ª NGINX ÉèÖÃÎļþ£¨Í¨³£Î»ÓÚ /etc/nginx/nginx.conf£©¡£
-
²éÕÒ Druid ЧÀÍÆ÷¿é
ÕÒµ½½ç˵ Druid ЧÀÍÆ÷¿éµÄÉèÖÿ顣Ëüͨ³£ÈçÏÂËùʾ£º
server { listen 8080; server_name example.com; location / { proxy_pass http://localhost:8082; } }
µÇ¼ºó¸´ÖÆ
-
½ûÓÃЧÀÍÆ÷¿é
ÔÚЧÀÍÆ÷¿éµÄ¿ªÍ·Ìí¼Ó server {} ¿é£¬ÒÔ±ã½ûÓÃËü¡£Ëü½«ÈçÏÂËùʾ£º
server { listen 8080; server_name example.com; return 403; location / { proxy_pass http://localhost:8082; } }
µÇ¼ºó¸´ÖÆ
return 403 Ö¸Áµ¼Ö NGINX ÏòʵÑé»á¼û Druid ЧÀ͵Ŀͻ§¶Ë·µ»Ø 403£¨Õ¥È¡£©¹ýʧ¡£
-
ÉúÑIJ¢ÖØмÓÔØ NGINX
ÉúÑÄ NGINX ÉèÖÃÎļþ²¢Ê¹ÓÃÒÔÏÂÏÂÁîÖØмÓÔØ NGINX£º
sudo nginx -s reload
µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬¶Ô Druid µÄ NGINX »á¼ûÓ¦¸ÃÒѱ»½ûÓá£ÈκÎʵÑé»á¼û Druid ЧÀ͵ÄÇëÇ󶼽«ÊÕµ½ 403 ¹ýʧ¡£
ÒÔÉϾÍÊÇNGINX½ûÓûá¼ûdruidµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡