Answer the question
In order to leave comments, you need to log in
How to select one route with http on a site with https?
Good day.
There is a site wrapped in https, there is only one page on it, on which there will be different iframes, which may very well not be https.
The next task is to show this page with https and a warning with a link to http (in fact, everything is done in the code), as well as to show it via http, redirecting the rest of the routes to https.
How it looks now:
server {
server_name server.com;
listen 80;
location ~ ^/(hello|hello/.*)$ {
uwsgi_pass django;
include uwsgi_params;
}
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
server {
listen 443 ssl spdy;
server_name server.com;
charset utf-8;
# всякие настройки ssl, логи и прочая джанго-статика
location / {
uwsgi_pass django;
include uwsgi_params;
}
}
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
Answer the question
In order to leave comments, you need to log in
do not use permanent, the 301 redirect is cached by the browser.
return 302 use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question