- Managing and auto-renewing your TLS certificates
- Distributing and accelerating your blog on a global content delivery network
- Protecting your blog from DDoS attacks with the firewall
Reserve a domain
Navigate to the Domains section of the ngrok dashboard and click New + to reserve a free static domain like or a custom domain you already own.This guide refers to this domain as
$NGROK_DOMAIN from here on out.Create a Traffic Policy file
On the system where Wordpress runs, create a file named What’s happening here? This policy rewrites the
wordpress.yaml and paste in the following policy:Host header of every HTTP request to localhost so that Wordpress accepts the requests.Start your Wordpress endpoint
On the same system where Wordpress runs, start the agent on port
80, which is the default for Wordpress, and referencing the wordpress.yaml file you just created.Optional: Restrict access to the admin dashboard
The WP Admin dashboard is protected by a username and password, but is often subjected to attacks. You can use therestrict-ips Traffic Policy action to allow only yours or other trusted IPs.
Edit your wordpress.yaml file with the following policy, replacing $YOUR_IP.
/wp-admin path. If it does, then it applies the restrict-ips action to allow only the addresses you explicitly added.
Then, as before, the policy rewrites the Host header of every HTTP request to localhost so that Wordpress accepts the requests.
Finally, restart your ngrok agent to apply the new policy.
What’s next?
- Read more about Traffic Policy and its core concepts.
- View your Wordpress traffic in Traffic Inspector.
- Use the
rewriteaction to create “pretty” blog URLs.