# Hello

**URL:** <https://www.ruby-forum.com/t/hello/238069>\
**Category:** NGINX\
**Created:** [December 15, 2013, 4:21pm UTC](https://www.ruby-forum.com/t/hello/238069 "2013-12-15T16:21:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 15, 2013, 4:21pm UTC](https://www.ruby-forum.com/t/hello/238069/1 "2013-12-15T16:21:39Z")

</div>

Hello, I have a nginx server is enabled.  
And I have a file called htaccess  
The file should cause to allowing accessed only from Israel.

But the file does not work,  
I realized that it is related to nginx only.

What can you do?

Posted at Nginx Forum:

> **[hello](https://forum.nginx.org/read.php?2,245545,245545#msg-245545)**
>
> Hello, I have a nginx server is enabled. And I have a file called htaccess The file should cause to allowing accessed only from Israel. But the file does not work, I realized that it is related to nginx only. What can you do?

---

<div class="post-metadata">

**Author:** ![nginx14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/94ad74/32.png) [@nginx14](https://www.ruby-forum.com/u/nginx14)\
**Post date:** [December 15, 2013, 4:25pm UTC](https://www.ruby-forum.com/t/hello/238069/2 "2013-12-15T16:25:09Z")

</div>

On 15 December 2013 15:21, nginx14 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello, I have a nginx server is enabled.  
> And I have a file called htaccess  
> The file should cause to allowing accessed only from Israel.
> 
> But the file does not work,  
> I realized that it is related to nginx only.

Nginx does not use htaccess files at all.  
You’ll need to work out how to express the Apache (htaccess file)  
config in nginx’s config syntax.

---

<div class="post-metadata">

**Author:** ![nginx14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/94ad74/32.png) [@nginx14](https://www.ruby-forum.com/u/nginx14)\
**Post date:** [December 15, 2013, 4:26pm UTC](https://www.ruby-forum.com/t/hello/238069/3 "2013-12-15T16:26:19Z")

</div>

Nginx does not use the .htaccess file, only Apache does. To prevent all  
users from accessing your site, except those coming from Israel, you can  
use the MaxMind Geo IP database in conjunction with an if statement in  
the  
Nginx configuration file. See  
[https://eng.eelcowesemann.nl/2011/blocking-unwanted-guests-with-nginx/](http://eng.eelcowesemann.nl/linux-unix-android/nginx/nginx-blocking/) for  
an  
example. Note that use of the “if” statement is not considered a great  
idea, see: [If is Evil… when used in location context | NGINX](http://wiki.nginx.org/IfIsEvil).

Ilan

On Sun, Dec 15, 2013 at 10:21 AM, nginx14 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [hello](http://forum.nginx.org/read.php?2,245545,245545#msg-245545)
> 
> * * *
> 
> nginx mailing list  
> removed\_email\_address@domain.invalid  
> [nginx Info Page](http://mailman.nginx.org/mailman/listinfo/nginx)

–

Ilan B.  
Chief Technology Officer

> **[Time4Learning.com](https://www.time4learning.com)**
>
> Award-winning online curriculum teaching math, language arts, science, social studies and more! Great for homeschool, afterschool & summer use.

6300 NE 1st Ave., Suite 203  
Ft. Lauderdale, FL 33334  
(954) 771-0914

[http://www.twitter.com/time4learning](http://www.twitter.com/time4learning)  
[http://www.facebook.com/Time4Learning](http://www.facebook.com/Time4Learning)

[Time4Learning.com](http://Time4Learning.com) - Online interactive curriculum for home use, PreK-8th  
Grade.  
[Time4Writing.com](http://Time4Writing.com) - Online writing tutorials for high, middle, and  
elementary school students.  
[Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
education, parenting and more.  
[spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for  
teachers,  
parents and students.
