0

I would like to ask, can anyone here advise on how to have a specific web address enabled to display only at a specific IP address that I choose?

I've only got HTML basics, and nowhere have I found a way to get this or are there any storage sites that support this?

I want it for storing a script I don't want to have publicly and I need it fixed to an IP address.

 javascript:$.getScript('secret url);void(0);

Thank you

Arnab
  • 4,216
  • 2
  • 28
  • 50
  • Please provide more information - especially about backend you are using as this most certainly has to be resolved in the backend. At the same time - IP address can be spoofed and therefore should not be considered as the (only) security option. – nettutvikler May 11 '20 at 12:20

1 Answers1

0

You will need to blacklist all other IPs and whitelist the IPs you want it to have access to.

Shared Hostings will have their own GUI for doing this but if you're hosting your app using a VPS (Virtual Private Server).

The most common approaches are:

Option #1: Through Web Server (Nginx, Apache, etc...)

Nginx

https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-proxied-tcp/#restricting-access-by-ip-address

Apache

https://httpd.apache.org/docs/2.4/howto/access.html

Option #2: Through Backend Server (PHP, Ruby, etc...)

PHP IP Address Whitelist with Wildcards

Note:

You will need to have your HTML page rendered using one of these approaches to make it work.

The flow would look like this:

User visits the page -> Web Server Checks If the IP is allowed -> Backend Server Checks if the IP is allowed (optional) -> Serve the HTML.

Community
  • 1
  • 1
Jerico Pulvera
  • 1,032
  • 7
  • 15