SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Список вопросов Печать

Примеры перенаправлений, переадресаций в веб серверах


Метки: nginx ssl apache 

Ответы

RemiZOffAlex  Создано: 2017-12-12 08:35:44.052161  Обновлено: 2017-12-12 08:35:44.052161

Apache

<VirtualHost *:80>
    ServerName test.local;
    Redirect 301 / https://test.local;
</VirtualHost>

Nginx

server {
   listen       443;
   server_name  test.local;
   access_log  /var/log/nginx/access-test.local.log  main;
   error_log   /var/log/nginx/error-test.local.log info;
   ssl on;
   ssl_certificate /etc/nginx/cert.crt;
   ssl_certificate_key /etc/nginx/cert.key;
   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

   return 301 http://specialistoff.net$request_uri;
}

Возможно будут интересны и другие вопросы