volgens Carolynn Bellavance.
When I go to https://domain.com/moodle/ it gives me the index page as if I was not logged in but when I click on the links it goes to https://192.168.0.26/whatever_comes_next
If I go to https://domain.com/moodle/login/index.php it works, but the moment I login it goes back to the ip address,
This only happens with moodle, all the other servers are available so I do not know where else I can ask for help. I am now running in circle editing config after config trying to figure out which one is missing....
This as worked in the past as the site was available before a failure of all the servers. I had to reboot everything and remake the the nginx server. Everything was copy/pasta of the last config but it still does not work as it did before.
Moodle config.php :
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->upgradekey = 'stuff';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'user';
$CFG->dbpass = 'password';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
);
$CFG->wwwroot = 'https://192.168.0.26';
$CFG->dirroot = '/var/www/moodle';
$CFG->dataroot = '/var/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 02777;
require_once(dirname(__FILE__) . '/lib/setup.php');
$CFG->reverseproxy = true;
//$CFG->sslproxy = true;
Nginx conf :
server {
listen 80;
server_name domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name domain.com;
root /var/www/domain;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/ssl/certs/www.domain.com.crt;
ssl_certificate_key /etc/ssl/private/www.domain.com.key;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;>
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/domain.access.log;
error_log /var/log/nginx/domain.error.log;
error_page 404 /custom_404.html;
location = /custom_404.html {
root /var/www/domain/;
internal;
}
error_page 500 502 503 504 /custom_50x.html;
location = /custom_50x.html {
root /var/www/domain/;
internal;
}
location /.well-known/acme-challenge/ {
alias /var/www/domain/;
try_files $uri =404;
}
location / {
try_files $uri $uri/ =404;
}
location ~ /\. {
deny all;
}
location /moodle/ {
proxy_pass https://192.168.0.26/;
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 $scheme;
proxy_read_timeout 90;
}
Moodle log file :
==> /var/log/apache2/access.log <==
192.168.1.201 - - [10/Jan/2018:10:07:25 -0500] "GET / HTTP/1.0" 200 7583 "-""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.css HTTP/1.1" 200 1758 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/styles.php/boost/1499973071/all HTTP/1.1" 200 110212 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/styles.php/boost/blocks/configurable_reports/js/codemirror/lib/codemirror.css HTTP/1.1" 404 257 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168..0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/styles.php/boost/blocks/configurable_reports/js/datatables/media/css/jquery.dataTables.css HTTP/1.1" 404 257 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/styles.php/boost/blocks/configurable_reports/js/codemirror/addon/display/fullscreen.css HTTP/1.1" 404 409 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /moodle/theme/image.php/boost/core/1499973071/t/collapsed_empty HTTP/1.1" 404 765 "https://192.168.0.26/theme/styles.php/boost/1499973071/all""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /moodle/theme/image.php/boost/core/1499973071/t/collapsed HTTP/1.1" 404 759 "https://192.168.0.26/theme/styles.php/boost/1499973071/all""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /moodle/theme/image.php/boost/core/1499973071/i/course HTTP/1.1" 404 756 "https://192.168.0.26/theme/styles.php/boost/1499973071/all""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/yui_combo.php?m/1499973071/core/event/event-min.js&m/1499973071/filter_mathjaxloader/loader/loader-min.js HTTP/1.1" 200 1398 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/yui_combo.php?m/1499973071/course/categoryexpander/categoryexpander-min.js HTTP/1.1" 200 2479 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /lib/requirejs.php/1499973071/core/first.js HTTP/1.1" 200 111696 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /lib/javascript.php/1499973071/lib/requirejs/jquery-private.js HTTP/1.1" 200 670 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /lib/javascript.php/1499973071/lib/jquery/jquery-3.1.0.min.js HTTP/1.1" 200 30756 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "GET /theme/yui_combo.php?3.17.2/event-mousewheel/event-mousewheel-min.js&3.17.2/event-resize/event-resize-min.js&3.17.2/event-hover/event-hover-min.js&3.17.2/event-touch/event-touch-min.js&3.17.2/event-move/event-move-min.js&3.17.2/event-flick/event-flick-min.js&3.17.2/event-valuechange/event-valuechange-min.js&3.17.2/event-tap/event-tap-min.js HTTP/1.1" 200 5382 "https://domain.com/moodle/""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
==> /var/log/apache2/error.log <==
[Wed Jan 10 10:07:25.570442 2018] [:error] [pid 27188] [client 192.168.0.160:39224] Default exception handler: Erreur de programmation d\xc3\xa9tect\xc3\xa9e. Ceci doit \xc3\xaatre corrig\xc3\xa9 par un programmeur\xc2\xa0: Invalid json in request: Syntax error Debug: \nError code: codingerror\n* line 42 of /lib/ajax/service.php: coding_exception thrown\n
==> /var/log/apache2/access.log <==
192.168.0.160 - - [10/Jan/2018:10:07:25 -0500] "OPTIONS /lib/ajax/service.php?sesskey=2mw4FF7tAe&info=core_fetch_notifications HTTP/1.1" 404 24237 "-""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
Nginx log file :
192.168.0.160 - - [10/Jan/2018:10:06:53 -0500] "GET /moodle/ HTTP/2.0" 200 7193 "-""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
If I change $CFG->wwwroot to https://domain.com/moodle it gives me error :
ERR_TOO_MANY_REDIRECTS
Nginx log file :
192.168.0.160 - - [10/Jan/2018:10:13:26 -0500] "GET /moodle/ HTTP/2.0" 303 636 "-""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
Moodle log file :
192.168.1.201 - - [10/Jan/2018:10:13:26 -0500] "GET / HTTP/1.0" 303 872 "-""Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"