FAQ

Page Discussion Edit History

RuHttpRefererModule

(Redirected from NginxRuHttpRefererModule)

Contents

[edit] ngx_http_referer_module

袦芯写褍谢褜 ngx_http_referer_module 锌芯蟹胁芯谢褟械褌 斜谢芯泻懈褉芯胁邪褌褜 写芯褋褌褍锌 泻 褋邪泄褌褍 褋 薪械胁械褉薪褘屑懈 蟹薪邪褔械薪懈褟屑懈 褋褌褉芯泻懈 "Referer" 胁 蟹邪谐芯谢芯胁泻械 蟹邪锌褉芯褋邪. 小谢械写褍械褌 懈屑械褌褜 胁 胁懈写褍, 褔褌芯 锌芯写写械谢邪褌褜 蟹邪锌褉芯褋 褋 薪褍卸薪芯泄 褋褌褉芯泻芯泄 "Referer" 薪械 褋芯褋褌邪胁谢褟械褌 斜芯谢褜褕芯谐芯 褌褉褍写邪, 锌芯褝褌芯屑褍 褑械谢褜 懈褋锌芯谢褜蟹芯胁邪薪懈褟 写邪薪薪芯谐芯 屑芯写褍谢褟 蟹邪泻谢褞褔邪械褌褋褟 薪械 胁 褋褌芯锌褉芯褑械薪褌薪芯屑 斜谢芯泻懈褉芯胁邪薪懈懈 锌芯写芯斜薪褘褏 蟹邪锌褉芯褋芯胁, 邪 胁 斜谢芯泻懈褉芯胁邪薪懈懈 屑邪褋褋芯胁芯谐芯 锌芯褌芯泻邪 蟹邪锌褉芯褋芯胁, 褋写械谢邪薪薪褘褏 芯斜褘褔薪褘屑懈 斜褉邪褍蟹械褉邪屑懈. 袧褍卸薪芯 褌邪泻卸械 褍褔懈褌褘胁邪褌褜, 褔褌芯 芯斜褘褔薪褘械 斜褉邪褍蟹械褉褘 屑芯谐褍褌 薪械 锌械褉械写邪胁邪褌褜 c褌褉芯泻褍 "Referer" 写邪卸械 写谢褟 胁械褉薪褘褏 蟹邪锌褉芯褋芯胁. 小芯写械褉卸邪薪懈械 袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈 袛懈褉械泻褌懈胁褘

袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈

: valid_referers   none  blocked  server_names
*.example.com  www.example.info/galleries/;

: if ($invalid_referer) {
: return   403;
: }

[edit] 袛懈褉械泻褌懈胁褘

  • [#valid_referers valid_referers]

Template:Anchor

[edit] valid_referers

syntax: valid_referers [none|blocked|server_names|褋褌褉芯泻邪] ...

default: 薪械褌

context: server, location

袛懈褉械泻褌懈胁邪 蟹邪写邪褢褌 蟹薪邪褔械薪懈褟 褋褌褉芯泻懈 "Referer" 胁 蟹邪谐芯谢芯胁泻械 蟹邪锌褉芯褋邪, 锌褉懈 泻芯褌芯褉褘褏 胁褋褌褉芯械薪薪邪褟 锌械褉械屑械薪薪邪褟 $invalid_referer 斜褍写械褌 懈屑械褌褜 蟹薪邪褔械薪懈械 0.

袩邪褉邪屑械褌褉褘 屑芯谐褍褌 斜褘褌褜 褋谢械写褍褞褖懈械:

  • none 鈥 褋褌褉芯泻邪 "Referer" 胁 蟹邪谐芯谢芯胁泻械 蟹邪锌褉芯褋邪 芯褌褋褍褌褋褌胁褍械褌;
  • blocked 鈥 褋褌褉芯泻邪 "Referer" 胁 蟹邪谐芯谢芯胁泻械 蟹邪锌褉芯褋邪 锌褉懈褋褍褌褋褌胁褍械褌, 薪芯 械褢 蟹薪邪褔械薪懈械 褍写邪谢械薪芯 褎邪泄褉胁芯谢谢芯屑 懈谢懈 锌褉芯泻褋懈-褋械褉胁械褉芯屑; 泻 褌邪泻懈屑 褋褌褉芯泻邪屑 芯褌薪芯褋褟褌褋褟 褋褌褉芯泻懈, 薪械薪邪褔懈薪邪褞褖懈械褋褟 薪邪 "http://";
  • server_names 鈥 胁 褋褌褉芯泻械 "Referer" 胁 蟹邪谐芯谢芯胁泻械 蟹邪锌褉芯褋邪 褍泻邪蟹邪薪芯 芯写薪芯 懈蟹 懈屑褢薪 褋械褉胁械褉邪;
  • 锌褉芯懈蟹胁芯谢褜薪邪褟 褋褌褉芯泻邪 鈥 蟹邪写邪褢褌 懈屑褟 褋械褉胁械褉邪 懈 薪械芯斜褟蟹邪褌械谢褜薪芯械 薪邪褔邪谢芯 URI. 袙 薪邪褔邪谢械 懈屑械薪懈 褋械褉胁械褉邪 屑芯卸械褌 斜褘褌褜 "*.". 袩褉懈 锌褉芯胁械褉泻械 锌芯褉褌 褋械褉胁械褉邪 胁 褋褌褉芯泻械 "Referer" 懈谐薪芯褉懈褉褍械褌褋褟.

袩褉懈屑械褉 懈褋锌芯谢褜蟹芯胁邪薪懈褟:

: valid_referers   none  blocked  server_names
*.example.com  www.example.info/galleries/;

[edit] References

Original Documentation