Title: Redirection error after publish &#8211; admin page works.
Last modified: July 21, 2020

---

# Redirection error after publish – admin page works.

 *  Resolved [mirky007](https://wordpress.org/support/users/mirky007/)
 * (@mirky007)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/redirection-madness/)
 * First off, I manage everything myself, own servers, etc.
 * **Short setup overview.**
    I use Cloudflare as DNS and Proxy. Full Strict mode,
   with “Authenticated Origin Pulls” on. + Always Use HTTPS = ON Automatic HTTPS
   Rewrites = ON. Everything else is pretty stock in cloudflare.
 * Then I have my own local Nginx proxy. Which has the certicates to handle encryption
   with cloudflare.
    And seperate Centos7/Apache servers for: Example.com wordpress.
   example.com simple.example.com
 * **Problem**
    My two wordpress installs on example.com and wordpress.example.com
   are entirely fresh and actually DO WORK, https and all …. BUT… As soon as I publish
   any changes to either, its when I get “ERR_TOO_MANY_REDIRECTS”. Funny thing is..
   thats what I used to fight on Wp-admin page to begin with, now Wp-admin works,
   but sites get broken. Sometimes when visiting main example.com it leads me to
   wordpress.example!. Or even oppesite I think I experienced.
 * At no point does anything happen to simple.example.com which is just simple apache
   install with sample page.
 * **A selection of things attempted.**
    Changing Themes.. saving settings page(
   if updating any broken) Saving permalinks page(if updating any broken)… WP-CLI
   Search-replace (To try and find faulty urls in database) Defining home and site
   url in wp-config. Clearing my cookies.
 * This code in wp-config.php which otherwise did fix my redirection problem on 
   Wp-admin page.
 *     ```
       define('FORCE_SSL_ADMIN', true);
       // in some setups HTTP_X_FORWARDED_PROTO might contain
       // a comma-separated list e.g. http,https
       // so check for https existence
       if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on';
       ```
   
 * **Local Nginx proxy sample. (This is the exact same for subdomain, ofc with other
   servername, IP, and cert)**
 *     ```
       server {
         server_name example.com;
   
       location / {
           proxy_pass http://10.10.10.10;
           proxy_set_header X-Forwarded-Proto https;
       }
           listen 443 ssl;
           ssl_certificate /etc/nginx/conf.d/certs/example.com.pem;
           ssl_certificate_key /etc/nginx/conf.d/certs/example.com.key;
   
           ssl_client_certificate /etc/nginx/conf.d/certs/origin-pull-ca.pem;
           ssl_verify_client on;
       }
       ```
   
 * **UPDATE:**
    I hoped to say my 3rd seperate install without subdomain to it had
   no problems. But it’s the same. Everything works, until I make a change and try
   to publish it. Admin area will continue to work, but site broken when it worked
   before.
    -  This topic was modified 5 years, 10 months ago by [mirky007](https://wordpress.org/support/users/mirky007/).
    -  This topic was modified 5 years, 10 months ago by [mirky007](https://wordpress.org/support/users/mirky007/).
    -  This topic was modified 5 years, 10 months ago by [mirky007](https://wordpress.org/support/users/mirky007/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [mirky007](https://wordpress.org/support/users/mirky007/)
 * (@mirky007)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/redirection-madness/#post-13166014)
 * FIXED.
 * Adding
    `proxy_set_header Host $host;` in my nginx proxy configs did the trick.
 * So this can be marked as solved, if i cannot find a button for it myself.
    -  This reply was modified 5 years, 10 months ago by [mirky007](https://wordpress.org/support/users/mirky007/).

Viewing 1 replies (of 1 total)

The topic ‘Redirection error after publish – admin page works.’ is closed to new
replies.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [nginx](https://wordpress.org/support/topic-tag/nginx/)
 * [proxy](https://wordpress.org/support/topic-tag/proxy/)
 * [subdomain](https://wordpress.org/support/topic-tag/subdomain/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [mirky007](https://wordpress.org/support/users/mirky007/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/redirection-madness/#post-13166014)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
