nginx https 如何将部分路径转移到 http

nginx https 如何将部分路径转移到 http

我有一个自己的网站,默认是走的 https,其中有一个路径需要走 http。

实现

在 nginx 的配置文件 https 中添加这个路径,并添加一个 rewrite 的指令。

比如我需要将 tools/iphone 的路径转成 http,就是下面这样配置

bash 复制代码
location / {
    try_files $uri $uri/ =404;
}

location /tools/iphone {
	rewrite ^(.*)$ http://$host$1  permanent; 
}

结果


相关推荐
碎碎念_4927 小时前
前后端分离项目开发规范
nginx·vue·springboot·restful
刘某的Cloud9 小时前
手工配置nginx的systemd服务
linux·运维·网络·nginx·systemd
刘某的Cloud11 小时前
Nginx 最小安全配置模板
linux·运维·nginx·安全·系统
Keepingrun11 小时前
http登录和授权
网络·网络协议·http
laoli_coding1 天前
如何配置HTTPS站点访问的免费SSL域名证书
网络协议·https·node.js·ssl
糖果店的幽灵1 天前
安全测试从入门到精通_网络基础与HTTPS
网络·https·php
Keepingrun1 天前
HTTP基础
网络·网络协议·http
2501_915716721 天前
Nginx网关讲解_小白版
运维·nginx
数据知道1 天前
HTTP/HTTPS 安全深度剖析:抓包、解密与证书陷阱
安全·http·https·mitmproxy·抓包解密
2501_915106321 天前
iOS 软件测试工具性能监控、日志分析 KeyMob、Instruments等
android·ios·小程序·https·uni-app·iphone·webview