nginx 部署 二级访问目录

  • Post author:
  • Post category:其他




nginx 部署 二级访问目录



nginx 配置 windows

server {
    listen        80;
    server_name  web.ttt.com;
    
    
    ## web1
    location / {
        root   "D:/phpstudy_pro/WWW/web1";
        index index.html;
        try_files $uri $uri/ /index.html;
    }

    ## api 配置
    location  ~/api {
        rewrite ^/api/(.*)$ /$1 break;
        proxy_set_header Host $host;
        proxy_pass_header User-Agent;
        ## 代理到后台接口
        proxy_pass http://127.0.0.1:9090;
    }
    
	## web2
    location /web2 {
        alias   "D:\phpstudy_pro\WWW\web2";
        index index.html;
        try_files $uri $uri/ /index.html;
    }

    

    
}



打包页面可能存在问题的地方

在这里插入图片描述



版权声明:本文为u010226719原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。