# IP Witelist for a web domain

**URL:** <https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920>\
**Category:** Uncategorized\
**Created:** [September 7, 2023, 4:46pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920 "2023-09-07T16:46:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![apexit.uk](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@apexit.uk](https://forum.hestiacp.com/u/apexit.uk)\
**Post date:** [September 7, 2023, 4:46pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/1 "2023-09-07T16:46:55Z")

</div>

Hi. let’s say I have a website: [example.com](http://example.com) which, for security reasons, I only want to allow access to a small handful of people. They’ll give me their public IP addresses and I’ll add them to a white list.

Can anyone advise if there’s a wayto do this in Hestia? Maybe there’s a way to do this int he DNS records? All my research points to blacklisting some IP addresses on the server’s firewall, I not only want to create a whitelist (not a black list) but I want it only for one domain/DNS zone on the server, not the entire server.

Many thanks

---

<div class="post-metadata">

**Author:** ![culibine](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/c/53a042/32.png) [@culibine](https://forum.hestiacp.com/u/culibine)\
**Post date:** [September 7, 2023, 6:23pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/2 "2023-09-07T18:23:16Z")

</div>

.htaccess allow deny from ip. For examples please refer to google.

---

<div class="post-metadata">

**Author:** ![apexit.uk](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@apexit.uk](https://forum.hestiacp.com/u/apexit.uk)\
**Post date:** [September 8, 2023, 11:08am UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/3 "2023-09-08T11:08:53Z")

</div>

Didn’t know .htaccess could be used to do things like that. Thanks, I’ll give it a try

---

<div class="post-metadata">

**Author:** ![apexit.uk](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@apexit.uk](https://forum.hestiacp.com/u/apexit.uk)\
**Post date:** [September 8, 2023, 11:33am UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/4 "2023-09-08T11:33:30Z")

</div>

Great, it worked. Thanks for the help. I inserted the following to my .htaccess file:

#Start Whitelist  
order deny,allow  
deny from all  
allow from 111.111.111.111  
#End Whitelist

---

<div class="post-metadata">

**Author:** ![luisedofon](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/l/839c29/32.png) [@luisedofon](https://forum.hestiacp.com/u/luisedofon)\
**Post date:** [August 21, 2024, 8:54pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/5 "2024-08-21T20:54:27Z")

</div>

Hi, just quick question, I’m not expert, but how this can be done on Hestia CP using Nginx only ? I found I can set allow some IP and later place a deny all; on /etc/nginx/nginx.conf, but this is applied to all websites, how can be done on only one of the sites ?

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/9318_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [August 21, 2024, 9:19pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/6 "2024-08-21T21:19:24Z")

</div>

> [@luisedofon](#):
>
> I can set allow some IP and later place a deny all; on /etc/nginx/nginx.conf, but this is applied to all websites, how can be done on only one of the sites ?

Let’s say your user is `test` and your domain is `example.net`, and you allow access to this site only to ips `203.0.113.1` and `192.0.2.1`

Create a conf file like `nginx.conf_whatever`, in this case, we will use `nginx.conf_access` and this file must be in this dir:

```t
/home/test/conf/web/example.net/

```

The contents of file `nginx.conf_access`:

```t
allow 203.0.113.1;
allow 192.0.2.1;
deny all;

```

If you are using ssl, create also a conf file `nginx.ssl.conf_access` but there is no need to create it from scratch, just create a symbolic link:

```t
cd /home/test/conf/web/example.net/
ln -rs nginx.conf_access nginx.ssl.conf_access

```

Now reload nginx:

```t
systemctl reload nginx

```

---

<div class="post-metadata">

**Author:** ![luisedofon](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/l/839c29/32.png) [@luisedofon](https://forum.hestiacp.com/u/luisedofon)\
**Post date:** [August 21, 2024, 9:28pm UTC](https://forum.hestiacp.com/t/ip-witelist-for-a-web-domain/10920/7 "2024-08-21T21:28:40Z")

</div>

Dear Sahsanu, you rock, thanks a lot, I really appreciate it 🙂 it worked, I was actually trying to edit nginx.conf file on /home/user/conf/web/example.net/.

I have to say in my 2 production VPS I’m using hestiacp, have test a lot of free options to leave my old shared reseller cPanel hosting soon and I simple love HestiaCP, hope I can contribute with some money soon 😃
