Use Varnish & NGINX to Serve WordPress over SSL & HTTP on Debian 8
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 1.2k
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the guide titled “Use Varnish & NGINX to Serve WordPress over SSL & HTTP on Debian 8” and compare its instructions with the reported setup details. Review the references to wp-config.php, /lib/systemd/system/varnish.service, and /etc/varnish/custom.vcl; done means incorporating only verified, still-relevant guidance about redirects, mixed content, and the Varnish service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- debian, nginx, php, wordpress
- Domain
- devops, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100