HomePage Redirect problem
Result
https://www.example.com
301 Moved Permanently
https://www.example.com/
301 Moved Permanently
https://www.example.com/
301 Moved Permanently
https://www.example.com/
>>> https://www.example.com
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status: 301 Moved Permanently
Code: 301
Date: Sun, 08 Mar 2020 17:12:27 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Set-Cookie: PHPSESSID=nc8ae71cti111f4886i4n88c8g; path=/
X-Powered-By: PHP/7.4.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Redirect-By: WordPress
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Location: https://www.example.com/
X-Varnish: 275505
Age: 0
Via: 1.1 varnish (Varnish/6.0)
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Alt-Svc: h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
Server: cloudflare
CF-RAY: 570e2e5f387adfbb-FRA
>>> https://www.example.com/
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status: 301 Moved Permanently
Code: 301
Date: Sun, 08 Mar 2020 17:12:27 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Set-Cookie: PHPSESSID=phieba6dvq78s19s6mnriqlkhi; path=/
X-Powered-By: PHP/7.4.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Redirect-By: WordPress
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Location: https://www.example.com/
X-Varnish: 275511
Age: 0
Via: 1.1 varnish (Varnish/6.0)
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Alt-Svc: h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
Server: cloudflare
CF-RAY: 570e2e625f301f15-FRA
Here is my nginx conf i use it for ssl since i have varnish on port 80 apache on port 8080 and nginx to lisen to 443 ssl.
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 443 ssl;
server_name _;
index index.php index.html index.htm;
ssl_certificate /etc/letsencrypt/live/www.sitename.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.sitename.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
}
}
}
My wordpress homepage in in infinite loop.
ERR_TOO_MANY_REDIRECTS
the rest of the website looks to work ok I have cloudflare as well as nameserver and caching. (the cookies all messed up also i think because i can't login to wp-admin)
I have checked using site http://www.redirect-checker.org/ and is telling that regular pages have like 4 redirects and homepage 19 (infinite loop)
Any idea how to fix ?