Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Varnish & NGINX to Serve WordPress over SSL & HTTP on Debian 8 #3065

Open
Rajakavitha1 opened this issue Jan 19, 2020 · 0 comments
Open

Comments

@Rajakavitha1
Copy link
Collaborator

Update the guide with the observations and suggestions:


If you get "Too many redirects" error as I was getting, this will fix it:

Open wp-config.php in your root wordpress directory
Add this line to the end of the file:

$_SERVER['HTTPS']='on';

PS: I'm still going through 1 more issue of some of the content loading like my header and slider, working on it. I don't think javascript is working. This is on Ubuntu 18.04.3 LTS (Bionic Beaver), nginx/1.14.0, varnish-5.2.1, php7.2

EDIT: Correction, add that line to the beginning of the wp-config.php file, along with these lines:
define('FORCE_SSL', true);
define('FORCE_SSL_ADMIN',true);
$_SERVER['HTTPS']='on';

If you have a problem with some content not loading as I did it's most likely because your site is trying to send javascript and cascade style sheets over http instead of https. I initiated a plugin called "http-https-remover" which solved this. Everything working 100% now thanks!
****************************************************************************************************Varnish was crashing after start and I couldn't figure out why...

I had to add a -F flag:
ExecStart=/usr/sbin/varnishd -F -a :80 -T localhost:6082 -f /etc/varnish/custom.vcl -S /etc/varnish/secret -s malloc,1G

After editing /lib/systemd/system/varnish.service i had to daemon-reload and tried starting varnish again and it worked. I was told if varnish.service was modified that a -F flag is required and it happened to fix my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant