Configure Nginx on macOS to serve WordPress website
11 March 2022 (Updated 17 March 2024)
On this page
This post assumes you installed Nginx via Homebrew and that its config lives in /opt/homebrew/etc/nginx
. Other installation methods may place the config files elsewhere.
Clone repo
Suppose you have a standard WordPress project like the one in this repo. Clone your repo.
Create Nginx config
Set its contents to:
Activate config.
Test config.
Reload Nginx.
Update /etc/hosts
and add the following entry.
Verify configuration
Navigate to http://wordpress-example-project.test and you should see the default WordPress installation page.
Sources
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment