softmaji-header-wbg-min
softmaji-header-wbg-min
softmaji-blue-header-min
softmaji-blue-header-min
  • Home
  • Services
    • Website Designing
      • Responsive Website Design
      • Static Website Design
      • Website Redesign
      • Landing Page Design
    • Website Development
      • PHP Website Development
      • WordPress Website Development
      • Ecommerce Website Development
      • Custom Website Development
    • Digital Marketing
      • Google Adwords/PPC
      • Facebook Promotion
    • SEO Service
  • Trainings
    • Learn Web Development
    • Learn Graphics Design
    • Learn Business Communication Skills
  • Pricing
  • Portfolio
  • Events
  • Offers
  • Contact Us

Steps to Configure Nginx for WordPress Statistics and Permalinks

HomeSteps to Configure Nginx for WordPress Statistics and Permalinks

Offer Expire Soon..


Only New User..


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.

Table of Contents

Toggle
  • WordPress Stats and Apache
  • WordPress Stats and Nginx
  • Steps to Enable Stats and Permalinks
  • Troubleshooting

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):

/home/username/example.com

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

/home/username/nginx/example.com

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

### stats
if ($request_uri ~* ^/(stats|failed_auth\.html).*$)
{
break;
}

Now after visiting example.com/stats, 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:

### stats
if ($request_uri ~* ^/(stats|doc|failed_auth\.html).*$)
{
break;
}
### Permalinks
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}

Troubleshooting

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

Faizan Khan
12
Latest News
Prev PostSteps to Replace a Hacked WordPress SiteMay 14, 2024
Next PostSteps to Add Users to WordPress MultisiteMay 14, 2024

Related items

otpless-issue
Latest News

OTPLess Not Working? Here’s What Happened!

Imagine this: You run a business, and suddenly, your customers can’t log in to your websit

SoftMaji InfoTech
20/06/2025
7
Latest News

How To Install WordPress Blog?

Let’s see how to install WordPress blog on your WordPress hosting account. Let’s

Faizan Khan
14/05/2024
149
Latest News

How to Install a Theme in WordPress?

Steps to install a theme in WordPress: Log in to WordPress. Navigate to Appearance and cli

Faizan Khan
14/05/2024
135
softmaji-header-wbg-min
SoftMaji is one of the affordable web development company in the web development industry. You don’t have to go searching anywhere for finding a reliable web development partner because we have crafted web development solutions that can fill the void left by others in the market.
Services
  • News Portal Development
  • Custom Website Development
  • PHP Website Development
  • Ecommerce Website Development
  • WordPress Website Development
Shortlinks
  • Blog
  • Offers
  • Events
  • Pricing
  • Reviews
  • Portfolio
  • Our Team
  • Payment Options
  • Explore Packages
Company
  • FAQ
  • Careers
  • Sitemap
  • Feedback
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions
  • Refund And Cancellation
Contact Us
4/40 Vipul Khand , Gomti Nagar Lucknow
Uttar Pradesh 226010
Landline - +915223162418
Email - hello@softmaji.in
Office Time Mon - Sat
(10:00AM - 5:00PM)
Sunday Close
+91 9795405324
Lucknow , Uttar Pradesh
Copyright © 2022. All Rights Reserved.