Answer the question
In order to leave comments, you need to log in
Redirect from http to https for feedback forms on nginx?
Hello.
There is a Debian + NGINX server without APACHE
It is necessary to implement a redirect from http to https on several pages.
Example:
www.site.com/admin -> https://www.site.com/admin/
and
www.site.com/feedback -> https://www.site.com/feedback/
Answer the question
In order to leave comments, you need to log in
I have done it this way, for several addresses you can try to do it through switch. And no regulars.
set $is_https 0;
if ($uri = /callback.php) {
set $is_https 1;
}
if ($is_https = 1) {
return 301 https://$host$request_uri;
}
There is no way to check, but I probably would have done this:
Added rewrite ^(.*) https://www.site.ru/admin$1 permanent to the main server;
I made a separate server in which everything for ssl is written, and the admin location is in it.
I'm not sure if this is correct, the first thing that came to mind.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question