Page 1 of 1

website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Mon May 02, 2022 5:02 am
by jesussuarez
I have been using vestacp for a couple of years.

I have a Laravel application that consumes an api from my website.

I don't want to do it via domain as I use cloudflare and this causes response delays.

On the other hand, I see little certainty that my website can be seen from the external IP of my server.

So, what I want to do is consult the external IP from my server, but that they cannot access from the internet

In this way, limit users who access from the Internet can only access through the domain that I have with cloudflare.

any ideas?

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Thu May 05, 2022 1:07 pm
by sandro
I think it's only possible if you control access via IP using a Firewall.

Depending on your need, a Layer 7 Firewall may be required.

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Thu May 05, 2022 3:18 pm
by jesussuarez
do you think it is possible to use the vestacp firewall?

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Mon May 09, 2022 6:37 pm
by sandro
If you want to limit (by source IP) who can access your application that is on Vesta, then yes.

The Vesta firewall is used to control access to services running on the Vesta server.

You will be able to enable access to a TCP or UDP port (or range of ports) and also define the source address of the connection to the service.

More than that, only if it is by command line in the console using iptables.

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Tue May 10, 2022 5:36 am
by jesussuarez
I'll leave it here in case someone has the same question.

your idea worked

however, in the case of cloudflare, I had to create a rule for each range of ips addresses here: https://www.cloudflare.com/es-es/ips/

all for port 80 and 443

I did this like this, since I tried to add them all in the same rule and I got the following error:

Code: Select all

Error: invalid ip format :: 103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,104.16.0.0/13

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Wed May 11, 2022 1:01 pm
by sandro
In case of using cloudflare you need to grant access to all IPs used by them.

You might need to create a rule for each IP range.

Re: website with domain, I want it to be accessed from the external IP only with ip 127...

Posted: Tue Jan 30, 2024 6:23 am
by laguaz
sandro wrote:
Wed May 11, 2022 1:01 pm
In case of using cloudflare you need to grant access to all IPs used by them.

You might need to create a rule for each IP range.
Thank you so much sandro! travelagu.io