技术实践

关于nginx正确的二级目录配置

关于nginx正确的二级目录配置

羊先生的头像
羊先生2023.03.14 · 1 分钟阅读 · 74 阅读
关于nginx正确的二级目录配置封面
文章正文还需 1 分钟
language 复制代码
location /guaranteetbr {

  add_header Access-Control-Allow-Origin *;
  alias   /home/java/front;
  try_files $uri $uri/ /home/java/front/index.html;

   location /guaranteetbr/sso {
        include extras/proxy.conf;
        proxy_set_header Host $http_host;
        proxy_pass http://192.168.10.138:30554/;
    }
    
    location /guaranteetbr/api {
        include extras/proxy.conf;
        proxy_set_header Host $http_host;
        proxy_pass http://192.168.1.48:7031/;
    }
    
    location /guaranteetbr/upload {
        include extras/proxy.conf;
        proxy_set_header Host $http_host;
        proxy_pass http://192.168.10.138:30554/upload;
    }

    location /guaranteetbr/public {
        include extras/proxy.conf;
        proxy_set_header Host $http_host;
        proxy_pass http://192.168.10.138:30557/public;
    }

}