S
S
Shing2018-12-05 20:40:58
Nginx
Shing, 2018-12-05 20:40:58

Http to Https redirect to NGINX for Wordpress multisite subdomains?

I tried a bunch of options and everything does not work, even https stops opening.
Now if http is called then the connection was reset

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Syomov, 2018-12-05
@Shing

Your redirect is generally correct, it's not about him, probably.
You should have two separate server sections, one of which provides a redirect on port 80, the second one allows the site to work on https. Perhaps this is the problem, since when you add a redirect, https also falls off for you?

server {
  listen 80;
  server_name sub1.mydomain.com sub2.mydomain.com;
  return 301 https://$host$request_uri;
}
server {
  listen 443 ssl;
  server_name sub1.mydomain.com sub2.mydomain.com;
  ...
}

S
Shing, 2018-12-05
@Shing

server_name sub1.mydomain.com sub2.mydomain.com;
return 301 https://$host$request_uri;
Browser: Invalid page redirect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question