Redirect loop after a fresh install

Redirect loop after a fresh install

ved Thibault CORDIER -
Antal besvarelser: 5

Hello, 

I am evaluating Moodle (moodle-latest-310.tgz) and tried a fresh install on :
Ubuntu 20.04 + Nginx + PHP-FPM 7.4 + MySQL 8.0

Installed via CLI

My problem is, after login,  i am redirect to "dashboard" > 303 Redirection loop to /my

What i am missing ? thanks

Gennemsnitsbedømmelse: -
I svar til Thibault CORDIER

Re: Redirect loop after a fresh install

ved Leon Stringer -
Billede af Core developers Billede af Particularly helpful Moodlers

Have you installed any themes or plugins? Something may be preventing access to the dashboard.

Under Site administration ▸ Appearance ▸ Navigation what is Home page for users set to? If it's Dashboard try changing it to Site. If you can't log into the site to change it, try adding:

$CFG->defaulthomepage = 0;

to config.php (before the require_once(__DIR__ . '/lib/setup.php')).

I svar til Thibault CORDIER

Re: Redirect loop after a fresh install

ved Matt T -
If you haven't installed any plugins, can you double check your nginx configuration? Follow the example here if you haven't already

I svar til Matt T

Re: Redirect loop after a fresh install

ved Thibault CORDIER -
I think my nginx configuration is good but i can miss something

And strangely if i disconnect, i am able to see the Homepage (course list)
server {
	server_name poc-moodle.xxxx.com;
        root /opt/moodle;

  # Cloudflare
	set_real_ip_from 173.245.48.0/20;
	set_real_ip_from 103.21.244.0/22;
	set_real_ip_from 103.22.200.0/22;
	set_real_ip_from 103.31.4.0/22;
	set_real_ip_from 141.101.64.0/18;
	set_real_ip_from 108.162.192.0/18;
	set_real_ip_from 190.93.240.0/20;
	set_real_ip_from 188.114.96.0/20;
	set_real_ip_from 197.234.240.0/22;
	set_real_ip_from 198.41.128.0/17;
	set_real_ip_from 162.158.0.0/15;
	set_real_ip_from 104.16.0.0/12;
	set_real_ip_from 172.64.0.0/13;
	set_real_ip_from 131.0.72.0/22;
	set_real_ip_from 2400:cb00::/32;
	set_real_ip_from 2606:4700::/32;
	set_real_ip_from 2803:f800::/32;
	set_real_ip_from 2405:b500::/32;
	set_real_ip_from 2405:8100::/32;
	set_real_ip_from 2a06:98c0::/29;
	set_real_ip_from 2c0f:f248::/32;
	real_ip_header CF-Connecting-IP;

	location / {
		try_files $uri /index.php$is_args$args;
	}

	location ~ [^/]\.php(/|$) {
		fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
		fastcgi_split_path_info  ^(.+\.php)(/.+)$;
		fastcgi_param   PATH_INFO       $fastcgi_path_info;
		fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include fastcgi_params;
		fastcgi_param   PATH_INFO       $fastcgi_path_info;
		fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
		
	}

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/poc-moodle.xxxx.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/poc-moodle.xxxx.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

I svar til Thibault CORDIER

Re: Redirect loop after a fresh install

ved Matt T -
First, try adding fastcgi_index index.php; as outlined on the linked page, and reload nginx.

I gather you're using Cloudflare. If it is presently enabled, can you try adding $CFG->reverseproxy = true; in config.php? (Process is similar to as Leon described above in relation to default homepage).

Sorry, but what do you mean by 'if i disconnect, i am able to see the Homepage'?