There is a site bulletin board. He works on subdomains. One city = 1 subdomain. For example: msk.site.ru
There is an ssl certificate (https) that works with all subdomains. Everything works, everything is okay. There is also a redirect from www. *. Site.ru to * .site.ru and accordingly from http to https.
Recently there was a problem with addresses like: https://www.msk.site.ru . It shows something like:
Your connection is not secure. The owner of www.msk.site.ru has incorrectly set up his website. To protect your information from being stolen, Firefox did not connect to this website.
However, this problem is only with https. Ie http://www.msk.site.ru will be redirected to https://msk.site.ru .
I tried to drive the following settings:
server { listen 80; server_name *.msk.site.ru; return 301 https://msk.site.ru$request_uri; } server { listen 443; ssl on; ssl_certificate /home/site/www/prod/ssl-bundle.crt; ssl_certificate_key /home/site/www/prod/site.key; #enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; server_name *.msk.site.ru; return 301 $scheme://msk.site.ru$request_uri; } The question is: How to redirect from https: // www. (...) .site.ru to https: // (...) .site.ru ?