Articles of nginx

Blog has an infinite redirect loop

Why is http://compassionpit.com/blog/ going through an infinite redirect loop? Here’s my nginx conf file. The site is run by a nodejs server on port 8000 and Apache serves up the blog (wordpress) and the forum (phpBB). The forum is resolving just fine, at http://www.compassionpit.com/forum/ … This webpage has a redirect loop The webpage at http://www.compassionpit.com/blog/ […]

WordPress in subdirectory, Multisite using subdomains Nginx

I’m usually running WP on Nginx + PHP-FPM in a sub-directory (similar to Mark Jaquith’s Skeleton) without any issues, all permalinks are working just fine. Now I tried to do this with WordPress Multisite and got some problems. My wp-config.php settings: // Give WordPress it’s own directory define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’] . ‘/core’ ); […]

Limit file downloads to logged in users (WP + Nginx)

I am looking for a way to restrict access to mp3 files on my site to logged in users only. The approach listed here sounds pretty much like what I need: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} ^.*(mp3|m4a)$ RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule . – [R=403,L] except how would I convert these .htaccess rules to […]

get_posts ignoring 'category' and displaying all posts

I’m going a bit crazy on this one. I’m trying to display a list of posts in a category on an Admin page in a plugin I am writing. The following code works fine on my dev server (OS X/Apache): $args = array( ‘posts_per_page’ => $pageSize, ‘offset’=> $offset, ‘category’ => 9 ); $posts = get_posts($args); […]

WordPress with Photocrati Theme keeps resetting site URL – help solving underlying problem

I have a website running the Photocrati theme version 4.9.3 on an AWS t2.micro running Amazon Linux. I use PHP 5.6 with php-fpm and a very recent version of Nginx, compiled with a couple of modules. I have CloudFlare in front of the website, but it accepts connections only from CloudFlare not directly. One WordPress […]

Enable Minify in W3Total Cache using NGINX

I am having an issue with enabling minify with the W3TC plugin. I am using a LEMP stack and cloudfront as a CDN, and all of these features, except for the minify work fine. In order to enable fancy permaplinks in WP I added /index.php?q=$uri&$args to the try_files line in sites-available and now all of […]

Is it safe to give wordpress directories ownership to www-data?

I am not server or security expert so please excuse if my question sounds odd. I am running wordpress site on ubuntu 14.04 with nginx server. I had a problem while installing new plugin, So I have changed all my wordpress directory permission from my server user to www-data and it started working fine. My […]

WordPress media upload “HTTP error”

When I try to upload an image, I get the following error: HTTP error. I know this problem has been solved hundred times but I can’t find the right answer form my configuration. In the php.ini, I have the following: upload_max_filesize = 50M max_file_uploads = 20 post_max_size = 50M And in my wp-config.php, I added: […]

Recommendation for server config for WordPress Staging servers

I’ve won a sweet managed VPS hosting package with Anchor (VPS D), and I’m looking for recommendations on how to set up the server. Anchor will setup apache or nginx for me – but which should I choose?! My considerations are: I’m concerned that there’ll be a big configuration shift between my staging server and […]

W3Total Cache problem with Nginx

Hi I installed w3 total cache on my nginx powered site, I’m having errors however. For example when I enable page caching disk:enhanced I get: It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in […]