Configure Nginx on Ubuntu 22.04 to serve WordPress website
11 March 2022 (Updated 27 May 2024)
Clone Git repo on server
SSH into your Ubuntu server and clone the Git repo into a desired location. Let’s assume:
- Git repo is git@github.com:sajadtorkamani/wordpress-deployer-example.git
- Repo location in filesystem is
/home/sajad/sites/wordpress-deployer-example
Create Nginx config
Set its contents to:
This config assumes you’ve already configured your DNS records to point wordpress-deployer-example.sajadtorkamani.com
to your server’s public IP address. Also note that if using a long server name like in the above config, you’ll want to edit the Nginx config .
Activate config.
Reload nginx.
Verify configuration
Now, visit wordpress-deployer-example.sajadtorkamani.com and you should see the WordPress website.
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment