{"id":7107,"date":"2019-05-31T08:36:27","date_gmt":"2019-05-31T08:36:27","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=7107"},"modified":"2019-05-31T08:36:27","modified_gmt":"2019-05-31T08:36:27","slug":"configure-nginx-for-wordpress-statistics-permalinks","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/","title":{"rendered":"Steps to Configure Nginx for WordPress Statistics and Permalinks"},"content":{"rendered":"<p>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.<\/p>\n<h3>WordPress Stats and Apache<\/h3>\n<p>You won\u2019t 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.<\/p>\n<h3>WordPress Stats and Nginx<\/h3>\n<p>After modifying the .conf file, you need to restart your VPS or reload your Dedicated server.<\/p>\n<p>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:<\/p>\n<p>It is the actual web directory (or document root):<\/p>\n<p><strong>\/home\/username\/example.com<\/strong><\/p>\n<p>It is nginx\/example.com directory which should include all config files:<\/p>\n<p><strong>\/home\/username\/nginx\/example.com<\/strong><\/p>\n<p>In this <strong>\/home\/username\/nginx\/example.com<\/strong> directory, create a file names as <strong>wordpress.conf<\/strong>. At the start of this <strong>wordpress.conf<\/strong> file, add the below rule:<\/p>\n<pre class=\"lang:default decode:true\">### stats\r\nif ($request_uri ~* ^\/(stats|failed_auth\\.html).*$)\r\n{\r\nbreak;\r\n}<\/pre>\n<p>Now after visiting <strong>example.com\/stats<\/strong>, a login prompt gets displayed permitting you to log in and check your site statistics.<\/p>\n<h3>Steps to Enable Stats and Permalinks<\/h3>\n<p>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:<\/p>\n<pre class=\"lang:default decode:true\">### stats\r\nif ($request_uri ~* ^\/(stats|doc|failed_auth\\.html).*$)\r\n{\r\nbreak;\r\n}\r\n### Permalinks\r\nif (!-e $request_filename) {\r\nrewrite ^.*$ \/index.php last;\r\n}<\/pre>\n<h3>Troubleshooting<\/h3>\n<p>In case you have enabled a stats user on the<strong> Site Statistics<\/strong> page but if stats are still not accessible, please contact MilesWeb support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[700,701,702],"class_list":["post-7107","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-wordpress-faq","tag-configure-nginx-for-wordpress","tag-nginx-and-wordpress","tag-wordpress-stats-and-permalinks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Configure Nginx for WordPress Statistics and Permalinks?<\/title>\n<meta name=\"description\" content=\"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Configure Nginx for WordPress Statistics and Permalinks?\" \/>\n<meta property=\"og:description\" content=\"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-31T08:36:27+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"Steps to Configure Nginx for WordPress Statistics and Permalinks\",\"datePublished\":\"2019-05-31T08:36:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\"},\"wordCount\":298,\"commentCount\":0,\"keywords\":[\"configure Nginx for WordPress\",\"Nginx and WordPress\",\"WordPress Stats and Permalinks\"],\"articleSection\":[\"WordPress FAQ\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\",\"name\":\"How to Configure Nginx for WordPress Statistics and Permalinks?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2019-05-31T08:36:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Steps to Configure Nginx for WordPress Statistics and Permalinks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"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.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Configure Nginx for WordPress Statistics and Permalinks?","description":"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/","og_locale":"en_US","og_type":"article","og_title":"How to Configure Nginx for WordPress Statistics and Permalinks?","og_description":"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-05-31T08:36:27+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"Steps to Configure Nginx for WordPress Statistics and Permalinks","datePublished":"2019-05-31T08:36:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/"},"wordCount":298,"commentCount":0,"keywords":["configure Nginx for WordPress","Nginx and WordPress","WordPress Stats and Permalinks"],"articleSection":["WordPress FAQ"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/","name":"How to Configure Nginx for WordPress Statistics and Permalinks?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2019-05-31T08:36:27+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"The article describes simple steps to configure Nginx for WordPress statistics and permalinks for your Nginx WordPress site.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/configure-nginx-for-wordpress-statistics-permalinks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Steps to Configure Nginx for WordPress Statistics and Permalinks"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"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.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=7107"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7107\/revisions"}],"predecessor-version":[{"id":7108,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7107\/revisions\/7108"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=7107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=7107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=7107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}