2018-02-01, 06:36 AM
I am getting error "Too many redirects" in browser whenever I try to access any thread using HTTPS. HTTP works fine.
All .php pages such as index.php, member.php also work fine on HTTPS and problem is with only those pages which are coming through URL rewriter such as threads and posts etc.. Here's my setup:
1. CloudFlare SSL is set to flexible i.e. site can be accessed via both HTTP and HTTPS
2. Site and Board URL in admin panel is set to "https://"
3. Here's my nginx file
I commented following two lines in my file above and also set ALWAYS USE HTTPS to ON in CloudFlare admin panel but still redirect error.
#return 301 https://www.mybb.com$request_uri;
#rewrite ^/([^&]*)&(.*)$ https://www.mybb.com/$1?$2 permanent;
All .php pages such as index.php, member.php also work fine on HTTPS and problem is with only those pages which are coming through URL rewriter such as threads and posts etc.. Here's my setup:
1. CloudFlare SSL is set to flexible i.e. site can be accessed via both HTTP and HTTPS
2. Site and Board URL in admin panel is set to "https://"
3. Here's my nginx file
server {
listen 80;
listen [::]:80;
server_name mybb.com;
return 301 https://www.mybb.com$request_uri;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/mybb/html;
index portal.php index.php index.html index.htm;
server_name www.mybb.com;
location / {
try_files $uri $uri/ = 404;
rewrite ^/([^&]*)&(.*)$ https://www.mybb.com/$1?$2 permanent;
rewrite ^/((?i)sitemap-([^./]+)\.xml)$ /misc.php?google_seo_sitemap=$2;
rewrite ^/((?i)Forum-([^./]+))$ /forumdisplay.php?google_seo_forum=$2;
rewrite ^/((?i)Thread-([^./]+))$ /showthread.php?google_seo_thread=$2;
rewrite ^/((?i)Announcement-([^./]+))$ /announcements.php?google_seo_announcement=$2;
rewrite ^/((?i)User-([^./]+))$ /member.php?action=profile&google_seo_user=$2;
rewrite ^/((?i)Calendar-([^./]+))$ /calendar.php?google_seo_calendar=$2;
rewrite ^/((?i)Event-([^./]+))$ /calendar.php?action=event&google_seo_event=$2;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
EDITI commented following two lines in my file above and also set ALWAYS USE HTTPS to ON in CloudFlare admin panel but still redirect error.
#return 301 https://www.mybb.com$request_uri;
#rewrite ^/([^&]*)&(.*)$ https://www.mybb.com/$1?$2 permanent;