MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Tips and Tricks => Topic started by: letux on 2016-11-11, 15:32:46

Title: resolve 'The page isn’t redirecting properly'
Post by: letux on 2016-11-11, 15:32:46
you  will got problem when Enable SSl 'i'am use let'sencrypt' with Apache and NginX-proxy.

Ok, Then ..
If you want to Enable SSl with Apache and NginX-Proxy you shuld follow this steps.

1- open SSh and login as root
2- then
Code: [Select]
cd '/opt/configs/nginx/conf/globals' 3- you will fiend four files
--- proxy_standard.conf
--- proxy_standard_ssl.conf
--- proxy_wildcards.conf
--- proxy_wildcards_ssl.conf

copy every file to custom file :

Code: [Select]
cp proxy_standard.conf custom.proxy_standard.conf
Code: [Select]
cp proxy_standard_ssl.conf  custom.proxy_standard_ssl.conf
Code: [Select]
cp proxy_wildcards.conf custom.proxy_wildcards.conf
Code: [Select]
cp proxy_wildcards_ssl.conf custom.proxy_wildcards_ssl.conf
and now you have custom copy from proxy files,

4- edit custom proxy files by vim or nano
Code: [Select]
nano custom.proxy_standard.conf
Find all the lines where it says proxy_set_header and add this line:
Quote
proxy_set_header X-Forwarded-Protocol $scheme;

Code: [Select]
nano custom.proxy_standard_ssl.conf
Find all the lines where it says proxy_set_header and add this line:
Quote
proxy_set_header X-Forwarded-Protocol $scheme;

Code: [Select]
nano custom.proxy_wildcards.conf
Find all the lines where it says proxy_set_header and add this line:
Quote
proxy_set_header X-Forwarded-Protocol $scheme;

Code: [Select]
nano custom.proxy_wildcards_ssl.conf
Find all the lines where it says proxy_set_header and add this line:
Quote
proxy_set_header X-Forwarded-Protocol $scheme;

5- after that run
Code: [Select]
sh /script/fixweb; sh /script/restart-all
6- Add this to the .htaccess of the domain with ssl:
Quote
SetEnvIf X-Forwarded-Protocol https HTTPS=on

------
if you still have problem, join to CP and open domain panel => Web Features
and change "Strict-Transport-Security "max-age=2592000; preload"" to "No-Strict-Transport-Security "max-age=2592000; preload""

and don't forgot set 'site url' in application using 'https://' instead 'http://'

thanks for chrisf
https://forum.mratwork.com/kloxo-mr-tips-and-tricks/php-force-redirect-ssl-nginxproxy-endless-loop/
and many thanks for Mostafa Ramadan
https://forum.mratwork.com/kloxo-mr-technical-helps/error-when-browsing-ssl-site/