Author Topic: Apache + Varnish + Nginx . WordPress SSL issues  (Read 10420 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Apache + Varnish + Nginx . WordPress SSL issues
« on: July 19, 2018, 04:59:49 PM »
Hi Forum
Has anyone tried to use Apache + Varnish + Nginx with WordPress/SSL sites? I am running a default install of CWP7 Pro with a Domain and SSL installed via AutoSSL.

When I enable Apache + Varnish + Nginx, the site goes down complaining "Too Many Redirects".   I have not manually configured any redirects, CWP7 handled the HTTP/HTTPS with AutoSSL and in wordpress i adjusted the SiteURL to https://

Has anyone else experienced similar issues?
« Last Edit: July 19, 2018, 05:06:03 PM by LostnIL »

Offline
*
Re: Apache + Varnish + Nginx . WordPress SSL issues
« Reply #1 on: July 19, 2018, 06:06:28 PM »
how did you set redirection from http to https ?
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
**
Re: Apache + Varnish + Nginx . WordPress SSL issues
« Reply #2 on: July 20, 2018, 12:15:43 PM »
I had the same issue before. It was a pain. I tried so many solutions but none work for me but this one. I hope it will workout for you.

Add this "return 301 https://$host$request_uri;" to your "nginx_proxy_vhost" like below:
Code: [Select]
root DOCROOT;
return 301 https://$host$request_uri;

location / {
location

That will redirect to https.

Offline
*
Re: Apache + Varnish + Nginx . WordPress SSL issues
« Reply #3 on: July 23, 2018, 02:23:26 PM »
Hi Forum
Has anyone tried to use Apache + Varnish + Nginx with WordPress/SSL sites? I am running a default install of CWP7 Pro with a Domain and SSL installed via AutoSSL.

Yes, but My site works but does not show the website correctly, only when opened with http://website will the Wordpress Site Show correctly with all GFX etc.. https://website gives more a text like website with missing formats etc..

For now sadly :( I have reverted to Apache Only ....
« Last Edit: July 23, 2018, 02:27:40 PM by Jason »

Offline
*
Re: Apache + Varnish + Nginx . WordPress SSL issues
« Reply #4 on: August 11, 2018, 04:47:51 PM »
I had the same issue before. It was a pain. I tried so many solutions but none work for me but this one. I hope it will workout for you.

Add this "return 301 https://$host$request_uri;" to your "nginx_proxy_vhost" like below:
Code: [Select]
root DOCROOT;
return 301 https://$host$request_uri;

location / {
location

That will redirect to https.

What if you want all traffic redirected to https://www.domain.tld?

I read that adding if statements in config files is frowned upon and that the best way is to add a separate server for domain.tld and one for www.domain.tld but I cannot get this to work.

I tried editing 'nginx_proxy_vhost_ssl' by removing YOURDOMAIN from server_name so only www.YOURDOMAIN remains and by adding another server directly below # Virtual host file starts here but it does not work.

Below is the top portion of my nginx_proxy_vhost_ssl template:
Code: [Select]
# Virtual host file starts here

# START of my edit to redirect to https://www.
server {
listen YOURSERVERIP:NGINXPORT;
server_name YOURDOMAIN;
return 301 $scheme://www.YOURDOMAIN$request_uri;
}
# !!! IMPORTANT - also had to remove YOURDOMAIN from server_name, a few lines below.
# END of my edit to redirect to https://www.

server {
listen YOURSERVERIP:NGINXPORT;
access_log /var/log/nginx/access.YOURDOMAIN.log;
error_log /var/log/nginx/error.YOURDOMAIN.log;
server_name www.YOURDOMAIN;
root DOCROOT;
...

So does this mean you can have only one server in the template?

Offline
*
Re: Apache + Varnish + Nginx . WordPress SSL issues
« Reply #5 on: September 22, 2018, 02:38:24 PM »
I found solution:

Remove SSL certificate for domain and install again :)

Regards
Chris