| Nginx-ru mailing list archive (nginx-ru@sysoev.ru) [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: permanent redirect для всех запросов кроме одного
 
 
On May 28, 2013, at 11:16 PM, Anatoly Mikhailov <anatoly@xxxxxxxxx> wrote:
> Есть следующий конфиг для перманентного редиректа HTTP на HTTPS:
> 
> server {
>  listen              80;
>  server_name         admin.sonru.com;
>  rewrite             ^(.*) https://$host$1 permanent;
> }
> 
> Задача в том, чтобы теперь перенаправлять http->https весь трафик кроме
> запроса на location = /health-check. Как это лучше всего сделать?
> 
задача то простая, но ее обычно так решают?
  if ($request_uri != '/health-check') {
    rewrite             ^(.*) https://$host$1 permanent;
  }
  location = /health-check {
    return 200;
  }
> Анатолий
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@xxxxxxxxx
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
 |