title: Wordpress and NGINX /wp-admin redirect loop
body: <p>My <code>nginx.conf</code> has a server blog containing this:</p>
  
  <pre><code>    location ~ \.php$ {
              root /var/www/html/blog;
              try_files $uri =404;
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              fastcgi_pass unix:/var/run/php5-fpm.sock;
              fastcgi_index index.php;
              include fastcgi_params;
      }
      location /blog {
              root /var/www/html/blog;
              include /etc/nginx/mime.types;
              try_files $uri $uri/ /index.php?q=$uri&amp;$args;
      }
  </code></pre>
  
  <p>But with these settings when I try to access <code>/blog/wp-admin</code> my browser gets stuck in some redirect loop.</p>
  
  <p>If I change the root URLs in <code>nginx.conf</code> to <code>/var/www/html</code>, <code>/blog/wp-admin</code> works, but my post permalinks give me a 404 error.</p>
  
  <p>My WP files are located in <code>/var/www/html/blog</code>. I have 'SSL Insecure Content Fixer' plugin installed because my images giving a mixed content error on my site, which has a Cloudflare page rule to always use SSL.</p>
  
  <p>My <code>WP address</code> and <code>WP home</code> are both set to <code>http://xxx/blog</code>.</p>
  
  <p>Anybody fixed something similar?</p>
  
  <p>Thanks</p>