Nginx переадресация c www на http
Материал из support.qbpro.ru
- Пример с просторов интернета:
server { server_name mysite.com; root /var/www/user/data/www/mysite.com; index index.php; try_files $uri $uri/ @rewrite; listen 123.456.789.11; listen 123.456.789.11 ssl http2; charset UTF-8; ..... set $root_path /.......; ssl_certificate /......; ssl_certificate_key /......; ...... ..... .......... add_header Strict-Transport-Security "max-age=31536000"; ..... ...... if ($scheme = http) { rewrite ^ https://$http_host$request_uri? permanent; } if ($http_host !~ "^mysite.com$"){ rewrite ^(.*)$ https://mysite.com$1 redirect; } ...... ..... }