我使用NGINX作为Web服务器。 我想在我的login页面中使用https ,所有其他页面都应该提供http连接。 当他键入“/ login”url前缀时,如何将用户redirect到https,然后在键入任何其他url后缀时redirect到“http”?
谢谢
比如像这样
server { listen *:80; ... location /login { return 301 https://$server_name$request_uri; } ... } server { listen *:443; ... location /login { # usual settings, proxy_pass etc... } location / { return 301 http://$server_name$request_uri; } }