D
D
dmx252018-03-13 22:15:10
Nginx
dmx25, 2018-03-13 22:15:10

Redirect from http to https in nginx for a specific directory?

How to make in nginx for url, for example, mysite.ru/catalog a redirect to https://mysite.ru/catalog/
A redirect is needed only for the /catalog directory and all attachments.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Skibin, 2018-03-14
@megafax

So?

location /catalog {
  return 301 https://$host$request_uri;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question