[SOLVED] Non-wanted redirection after Letsencrypt patch

Hello there!

I have a few webs running in a same VPS, all of them created/managed with EE.

Today I was trying to update one of them to HTTPS with the Let’s Encrypt command, but when the hack was done, the redirection went wrong and redirected to one of my another sites (hosted in my VPS).

I’ve checked the following nginx redirection files looking for any error but everything seems fine.

/etc/nginx/conf.d/force-ssl-example.com.conf /etc/nginx/sites-available/example.com

I’ve stepped back to HTTP (letsencrypt off) and the web worked fine.

Google want us to get our HTTPS right, so I want to update that web asap.

Anyone has won this struggle? Any ideas?

Thanks in advance.

Hello deivri, you have to check if you have a file /var/www/yourdomain.tld/conf/nginx/ssl.conf with the following content :

listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl on;
    ssl_certificate     /etc/letsencrypt/live/yourdomain.tld/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/yourdomai/privkey.pem;

And you file /etc/nginx/conf.d/forcessl-youdomain.tld.conf should look like :

server {
	listen 80;
        listen [::]:80;
	server_name yourdomain.tld www.yourdomain.tld;
	return 301 https://yourdomain.tld$request_uri;

Then just check you nginx configuration with nginx -t And apply the configuration with service nginx reload

1 Like

Thanks for your reply!

Everything was fine in those files.

When I’ve tried with https://www.example.com redirected to https://www.anotherexample.com.

Then I’ve tried with https://www.example.com/random.file and it worked, so I’ve tried to login in my wp instalation (lucky me, it worked) and purge cache and everything. Problem solved. The most weird cache issue.