Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

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

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
jesussuarez
Posts: 5
Joined: Mon May 02, 2022 4:56 am
Contact:
Contact jesussuarez
Twitter

Os: CentOS 6x
Web: apache + nginx
website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by jesussuarez » Mon May 02, 2022 5:02 am

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?
Top

sandro
Support team
Posts: 87
Joined: Sun Aug 30, 2020 11:02 am

Os: CentOS 6x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by sandro » Thu May 05, 2022 1:07 pm

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.
Top

jesussuarez
Posts: 5
Joined: Mon May 02, 2022 4:56 am
Contact:
Contact jesussuarez
Twitter

Os: CentOS 6x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by jesussuarez » Thu May 05, 2022 3:18 pm

do you think it is possible to use the vestacp firewall?
Top

sandro
Support team
Posts: 87
Joined: Sun Aug 30, 2020 11:02 am

Os: CentOS 6x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by sandro » Mon May 09, 2022 6:37 pm

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.
Top

jesussuarez
Posts: 5
Joined: Mon May 02, 2022 4:56 am
Contact:
Contact jesussuarez
Twitter

Os: CentOS 6x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by jesussuarez » Tue May 10, 2022 5:36 am

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
Top

sandro
Support team
Posts: 87
Joined: Sun Aug 30, 2020 11:02 am

Os: CentOS 6x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by sandro » 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.
Top

laguaz
Posts: 8
Joined: Fri Dec 06, 2019 4:51 am

Os: Ubuntu 17x
Web: apache + nginx
Re: website with domain, I want it to be accessed from the external IP only with ip 127...
  • Quote

Post by laguaz » Tue Jan 30, 2024 6:23 am

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
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password