# Problem with NginxHttpRefererModule

**URL:** <https://www.ruby-forum.com/t/problem-with-nginxhttpreferermodule/193698>\
**Category:** NGINX\
**Created:** [August 22, 2010, 4:47pm UTC](https://www.ruby-forum.com/t/problem-with-nginxhttpreferermodule/193698 "2010-08-22T16:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antituhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@antituhan](https://www.ruby-forum.com/u/antituhan)\
**Post date:** [August 22, 2010, 4:47pm UTC](https://www.ruby-forum.com/t/problem-with-nginxhttpreferermodule/193698/1 "2010-08-22T16:47:06Z")

</div>

Hi,

My server using nginx/0.8.49, and I try to using NginxHttpRefererModule.

This is my configuration :

```
location / {
    root /var/www/iKocok/;
    index index.html index.htm index.php;
    valid_referers server_names blocked none *.antituhan.com;
    if($invalid_referer) {
        return 404;
    }
}

```

But this error occur :

Starting nginx: [emerg]: unknown directive “if($invalid\_referer)” in  
/etc/nginx/sites-enabled/antituhan.com:11

How to fix this problem ?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![antituhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@antituhan](https://www.ruby-forum.com/u/antituhan)\
**Post date:** [August 22, 2010, 5:19pm UTC](https://www.ruby-forum.com/t/problem-with-nginxhttpreferermodule/193698/2 "2010-08-22T17:19:53Z")

</div>

Hi,

> Starting nginx: [emerg]: unknown directive “if($invalid\_referer)” in  
> /etc/nginx/sites-enabled/antituhan.com:11

Add space between “if” and “(”.

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>

---

<div class="post-metadata">

**Author:** ![antituhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@antituhan](https://www.ruby-forum.com/u/antituhan)\
**Post date:** [August 23, 2010, 8:46am UTC](https://www.ruby-forum.com/t/problem-with-nginxhttpreferermodule/193698/3 "2010-08-23T08:46:27Z")

</div>

Hi Piotr S.,

## Simple problem 🙂 Works like a charm, thanks for help 🙂

View this message in context:  
[http://nginx.2469901.n2.nabble.com/Problem-with-NginxHttpRefererModule-tp5449838p5451592.html](http://nginx.2469901.n2.nabble.com/Problem-with-NginxHttpRefererModule-tp5449838p5451592.html)  
Sent from the nginx mailing list archive at [Nabble.com](http://Nabble.com).
