proxy error

proxy error

by Mustafa Nasereddin -
Number of replies: 4

after moving my site from windows to centos through installing new moodle 3.3.3+ and restoring the old database and copying moodledata from old server to new one and done upgrade the database 

my site worked perfectly nut the old one was published on internet through proxy


now when i put 

reverseproxy =true in config.php

my site worked on internet but stopped worked internally with error

reverseproxy enabled , you cannot access directly


when putting 

reverse proxy = false 

the site worked normally internally but stopped from outside internet

with error too many redirect

any one help please


Average of ratings: -
In reply to Mustafa Nasereddin

Re: proxy error

by Ken Task -
Picture of Particularly helpful Moodlers

That setting in the config.php file set *only if* your web server is setup to run as proxied.

https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

'spirit of sharing', Ken



In reply to Ken Task

Re: proxy error

by Mustafa Nasereddin -

thanks for your reply

but if i want to run my site as non proxied what should i do to get it work from internet

it keeps give me err_too_many_redirects

In reply to Mustafa Nasereddin

Re: proxy error

by Ken Task -
Picture of Particularly helpful Moodlers

From one of your posting you indicate it was a proxied when on Windows.  Was old site setup with load balancing?  Networking comes before application, so is there something network wise that is in front of the CentOS server you now have that expects the CentOS server to be proxied?

If you don't need the proxy line in config.php, rather than setting it to 'false' just comment out the line with // in front of that line.  No need to restart apache, just access the site.

What is in your httpd.conf file?   Are there settings for 'proxy'?

Web server logs /var/log/httpd/ especially the error_log ... shows/says nothing?

From command line, cd /var/www/html/ (where your moodle code probably resides.

Then again cd admin/cli/

Run php cfg.php |grep proxy

That script reads the DB for settings .... all of them ....

On a server that is not proxied, this is what should show:

[root@sos cli]# php cfg.php |grep proxy
proxyhost   
proxyport    0
proxytype    HTTP
proxyuser   
proxypassword   
proxybypass    localhost, 127.0.0.1

There should also be no active proxy settings in /etc/httpd/conf/httpd.conf file.

fgrep 'proxy' /etc/httpd/conf/httpd.conf

should show nothing.

Purge the moodle cache manually.

cd /path/to/moodledata/

manually remove contents of cache, localcache directories.    Those should rebuild as site is used.

Turn on debugging via config.php file:

// @error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!
// @ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!
// $CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCT$
// $CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!

'spirit of sharing', Ken