What is the name of the domain?
saranapemilu.online
What is the error number?
301 Redirection infinite Loop
What is the error message?
301 Redirection infinite Loop
What is the issue you’re encountering
301
What steps have you taken to resolve the issue?
the Always use https is disabled, the SSL/TLS encryption mode is flexible
What are the steps to reproduce the issue?
I recently setup my wordpress site that hosted on openBSD server with cloudflare. I want for 2 hours for the cloudflare is fully enabled but when i try to open my site i got “ERR_TOO_MANY_REDIRECTS”. When i check the redirection tool, it got redirected 301 too many times.
here my nginx configuration:
user www;
worker_processes 1;
pid /var/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
default_type application/octet-stream;
keepalive_timeout 15;
client_body_timeout 30;
client_header_timeout 30;
send_timeout 30;
client_max_body_size 64m;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
gzip on;
gzip_disable “msie6”;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
upstream php82 {
server unix:run/php-fpm.sock;
}
include /etc/nginx/upstreams/*.conf;
map '' $upstream {
default php83;
}
server_tokens off;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
large_client_header_buffers 2 1k;
#limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
#limit_req zone=one burst=5;
include /etc/nginx/conf.d/*.conf;
}
and the server block config:
fastcgi_cache_path /var/www/saranapemilu.online/cache/ levels=1:2 keys_zone=saranapemilu.online:100m max_size=10g inactive=60m;
server {
listen 443;
listen [::]:443;
server_name saranapemilu.online;
ssl_certificate /etc/ssl/saranapemilu.online.fullchain.pem;
ssl_certificate_key /etc/ssl/private/saranapemilu.online.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';
ssl_ecdh_curve X25519:prime256v1:secp521r1:secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 1.0.0.1 valid=60s;
server_tokens off;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block";
#add_header X-Content-Type-Options "nosniff" always;
#add_header Content-Security-Policy "default-src 'self';" always;
add_header Referrer-Policy "same-origin";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
root /var/www/saranapemilu.online/public;
access_log /var/www/saranapemilu.online/logs/access.log;
error_log /var/www/saranapemilu.online/logs/error.log;
index index.php;
error_page 404 /404.html;
location = /404.html {
root /var/www/saranapemilu.online/public;
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/saranapemilu.online/public;
internal;
}
location ~* /\.(?!well-known\/) {
deny all;
}
location ~\.(ini|log|conf)$ {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires 0;
}
location ~* \.(?:rss|atom)$ {
expires 1h;
}
location ~* \.(?:webp|ico|cur|gz|svg|mp4|mp3|ogg|ogv|webm|htc)$ {
expires 1y;
access_log off;
}
location ~* \.svgz$ {
expires 1y;
access_log off;
gzip off;
}
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
}
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
expires 1y;
access_log off;
add_header Access-Control-Allow-Origin *;
}
location = /robots.txt {
try_files $uri $uri/ /index.php?$args;
access_log off;
log_not_found off;
}
set $skip_cache 0;
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
if ($request_uri ~* "/wp-admin/|/wp-json/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml|/cart/|/checkout/|/my-account/") {
set $skip_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") {
set $skip_cache 1;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
location /.well-known/acme-challenge/ {
rewrite ^/.well-known/acme-challenge/(.*) /$1 break;
root /acme;
}
location = /.well-known/acme-challenge/ {
return 404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_cache saranapemilu.online;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_valid 200 301 302 10m;
fastcgi_cache_valid 404 1m;
fastcgi_cache_use_stale error timeout updating http_500 http_503;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache_lock on;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
fastcgi_cache_lock_timeout 5s;
fastcgi_cache_methods GET HEAD;
add_header X-Fastcgi-Cache $upstream_cache_status;
add_header Cache-Control "public, max-age=600";
}
}
server {
listen 80;
listen [::]:80;
server_name saranapemilu.online;
return 301 https://saranapemilu.online$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name www.saranapemilu.online;
return 301 https://saranapemilu.online$request_uri;
}