Lightsail Public IP and Distribution

0

Hello.
I have LightSail's instance running LAMP. The architecture looks like this....
Google Domain -> Route 53 -> LightSail Distribution -> LightSail Load Balancer -> Light Sail Instances.

All works....however, the problem is that google has managed to index the LightSail instance IP addresses so basically, anyone doing a google search can find the server IP. And also, google is indexing the LoadBalancer IP.

Is there a way to prevent this from happening? I don't want people to find out what the IP address is..thats why I put a Distribution and load balancer before.

Edited by: extjac1 on Nov 2, 2021 3:31 PM

extjac1
asked 2 years ago548 views
1 Answer
0

cd /opt/bitnami/apache/conf/bitnami

#sudo nano bitnami.conf

<VirtualHost *:80>
ServerName <Your-lightsail-static-IP>
Redirect 403 /
ErrorDocument 403 "Sorry, direct IP access not allowed."
DocumentRoot /dev/null/
UseCanonicalName Off
</VirtualHost>

#sudo nano bitnami-ssl.conf

<VirtualHost *:443>

SSLCertificateFile "/opt/bitnami/apache/conf/bitnami/certs/server.crt" <----- modify the path to SSLCertificateFile for your instance
SSLCertificateKeyFile "/opt/bitnami/apache/conf/bitnami/certs/server.key" <----- modify the path to SSLCertificateKeyFile for your instance

ServerName <Your-lightsail-static-IP>
Redirect 403 /
ErrorDocument 403 "Sorry, direct IP access not allowed."
DocumentRoot /dev/null/
UseCanonicalName Off
</VirtualHost>

extjac1
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions