title: too many redirects for wordpress on nginx with apache2
body: <p>I have just installed wordpress on ubuntu 14.04 LTS. Nginx acts as reverse proxy for apache2.</p>
  
  <p>wp-admin is working fine, but I am unable to open the homepage.</p>
  
  <p>Nginx Server Code:</p>
  
  <pre><code>server {
          listen 80;
  
          root /var/www/html/testblog;
          index index.php index.html index.htm;
  
          server_name testblog.com;
  
          location / {
                  # try_files $uri $uri/ =404;
                  try_files $uri $uri/ /index.php?q=$uri&amp;$args;
          }
  
          error_page 404 /404.html;
  
          error_page 500 502 503 504 /50x.html;
          location = /50x.html {
                  root /usr/share/nginx/html;
          }
  
          location ~ \.php$ {
                  proxy_set_header X-Real-IP  $remote_addr;
                  proxy_set_header X-Forwarded-For $remote_addr;
                  proxy_set_header Host $host;
                  proxy_pass http://127.0.0.1:8182;
          }
  
          location ~ /\.ht {
                  deny all;
          }
  }
  </code></pre>
  
  <p>Apache Virtual Host Conf:</p>
  
  <pre><code>&lt;VirtualHost *:8182&gt;
          ServerName testblog.com
  
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/html/testblog
  
          ErrorLog ${APACHE_LOG_DIR}/errortest.log
          CustomLog ${APACHE_LOG_DIR}/accesstest.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>My /etc/hosts:</p>
  
  <pre><code>127.0.0.1       localhost
  127.0.0.1       ubuntu
  127.0.1.1       testblog.com
  </code></pre>
  
  <p>I have all the wp files in the folder /var/www/html/testblog/.</p>
  
  <blockquote>
    <p>testblog.com/wp-admin: working fine.</p>
    
    <p>testblog.com: giving too many redirects.</p>
  </blockquote>
  
  <p><a href="http://i.stack.imgur.com/NNfpN.png" rel="nofollow">Here is my settings page:</a></p>
  
  <p>I guess my settings are correct. I have tried defining WP_HOME and WP_SITEURL in wp-config.php, but no luck.</p>
  
  <p>My /var/www/html/testblog/.htaccess:</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <blockquote>
    <p>testblog.com/wp-admin: working.</p>
    
    <p>testblog.com: giving too many redirects error</p>
  </blockquote>
  
  <p>Any help is highly appreciated.</p>
  
  <p><strong>Edit:</strong> I have already disabled all the plugins.</p>