Knowledge Base
MilesWeb / WordPress FAQ

Steps to Configure Nginx for WordPress Statistics and Permalinks

Approx. read time : 2 min

A high performance web server, Nginx is used as an alternative to the popular Apache web server. WordPress works smoothly on Nginx machines, but in order to get site statistics to work similar to Apache, you need to adjust some files. In this article, you will be able to view your Analog stats after enabling stats in your MilesWeb panel.

WordPress Stats and Apache

You won’t see the site statistics initially available when running WordPress. But when WordPress runs on an Apache server, you can view the /stats subdirectory to serve your site statistics, using an .htaccess file.

WordPress Stats and Nginx

After modifying the .conf file, you need to restart your VPS or reload your Dedicated server.

When you use Nginx, your .htaccess file does not work. Therefore, you need to add code to another file for viewing your stats. Your Nginx WordPress site comprises of two directories:

It is the actual web directory (or document root):


It is nginx/ directory which should include all config files:


In this /home/username/nginx/ directory, create a file names as wordpress.conf. At the start of this wordpress.conf file, add the below rule:

Now after visiting, a login prompt gets displayed permitting you to log in and check your site statistics.

Steps to Enable Stats and Permalinks

Permalinks are used by WordPress to make the URLs easily readable. Add the below two sections while running Nginx to obtain both site statistics as well as permalinks to function:


In case you have enabled a stats user on the Site Statistics page but if stats are still not accessible, please contact MilesWeb support.

Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.