nginx配置多个web项目

复制代码
location / {
            root   html;
            index  index.html index.htm;
        try_files $uri $uri/ /index.html;
}
        
location /mobile {
            # 多层目录时不能用root,要用alias
            alias   html/mobile;
            index  index.html index.htm;
        try_files $uri $uri/ /mobile/index.html;
}
复制代码

 目录结构(mobile里是另一个web项目):

 

posted @   yw3692582  阅读(143)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示