1

I'm trying to scale up a Lightsail instance. It's a basic Wordpress site on an Amazon Linux 2 AMI running nginx and mariadb. It's using a static IP. Works fine.

When I create a snapshot of it, use it to launch a larger instance, and then attach the static IP, it simply doesn't work. Nginx is running and giving a 404 for the IP, but it times out when trying to access the domain. No errors at all. Nothing in the access log. I've made no changes to anything. The only thing I've done is restart nginx and php-fpm.

I've double checked and triple checked that all of the conf files are the same. Is there something else I'm missing? Is the IP of the new instance being used somewhere before I attach the static IP?

Jailbot
  • 111
  • 2
  • Is the original instance still running? Is your request going to the original instance? Try accessing it with the public IP before the Elastic / Static IP is attached. – Tim May 19 '21 at 19:00
  • @Tim I get the same behavior with static IP attached whether the original instance is stopped or not and the same behavior when it's pointed at new IP. – Jailbot May 19 '21 at 19:38
  • Create a new instance from snapshot but don't attach the static IP. Update your hosts file on your PC to hard code the domain to that IP. Make a get request based on the public IP, check Nginx logs. Report back results of request and log entries. – Tim May 19 '21 at 20:04
  • Did all of the above. Mostly same results - hadn't tried w/ & w/o https before, but it times out with https and the 301s are intended behavior; maybe an issue with SSL? Default error.log is blank. No new entries in the site specific logs. Only entries in default access.log, as seen here: https://a.cl.ly/7KuPYArP (big block up top is just old (similar) entries from earlier) – Jailbot May 19 '21 at 20:32
  • Now you just need to go through the process of Nginx configuration, adding static IP, etc. There's no one answer, you just need to follow a logical process and work through it – Tim May 19 '21 at 20:36
  • Sorry, that's why I'm confused though: Nginx is configured. If the snapshot is a perfect copy, then why would there need to be any configuration to change? I can't find any file in which an IP address is included explicitly. There's no answer I can think of for why this instance is in any way different from the original, although that's obviously not the case. – Jailbot May 19 '21 at 20:54
  • Bit tricky to work out / diagnose based on information provided. Snapshot should be perfect copy, might be DNS not updating quickly but hard coding hosts file can help work that out. – Tim May 19 '21 at 21:43

1 Answers1

0

The answer is about as frustrating as a missing comma: port 443 wasn't open on the new instance.

The snapshot is indeed a perfect copy, but when you create a new instance from a snapshot in Lightsail, Lightsail doesn't duplicate your networking settings. You need to set those again manually.

Jailbot
  • 111
  • 2