Grav on AWS Lightsail with Nginx

I got the idea from the documentation that Nginx is a preferred server, so I set up an AWS Lightsail instance with Nginx. I then unzipped grav-admin 1.7.10 into /opt/bitnami/nginx/html after deleting the default index.html and 50x.html files (after backing them up). Now I’m getting an HTTP 500 error, presumably because the default config does not find index.php files and probably other settings that are needed. Is there a place I can find a basic config for AWS Lightsail with Bitnami Nginx? The default config in the documentation is very different from what’s already there and refers to things like www-data and /var/www/ that are not on this distribution (it uses bitnami as the user and /opt/bitnami/nginx for example.

Or should I rather install Nginx from scratch or use a different stack?

I decided to start with a blank EC2 instance instead (tg4-micro), using Ubuntu 20.04 LTS. Following the instructions from several sources, I got it working.

Sources:

  • Install | NGINX

  • Nginx | Grav Documentation, and also see the link on that page to Troubleshooting Permissions, using the manual permissions because the nginx package uses an nginx user vs the www-data user for PHP-FPM. I made the owner:group as nginx:www-data

  • I can only post 2 links as a newbie, so cannot post the last link but look for the DigitalOcean setup in the Grav Documentation (prevous link) for PHP installation, FPM and connection pool

2 Likes