Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular11应用程序在microservice体系结构中找不到.js和.css文件_Angular_Docker_Nginx - Fatal编程技术网

Angular11应用程序在microservice体系结构中找不到.js和.css文件

Angular11应用程序在microservice体系结构中找不到.js和.css文件,angular,docker,nginx,Angular,Docker,Nginx,对于一个项目,我必须在运行的微服务架构中包含我的角度前端。Angular应用程序在Docker容器中运行,如果我直接在“localhost:4200”访问它,一切都可以正常工作。将其添加到microservice时,我必须编辑nginx配置,并使其在“localhost/xyz frontend”处可访问 当我在“localhost/xyz frontend”访问前端时,它返回一个有效的HTML,其中包含我的应用程序的正确标题。但是所有的JavaScript和CSS文件都没有通过,我收到了一个3

对于一个项目,我必须在运行的微服务架构中包含我的角度前端。Angular应用程序在Docker容器中运行,如果我直接在“localhost:4200”访问它,一切都可以正常工作。将其添加到microservice时,我必须编辑nginx配置,并使其在“localhost/xyz frontend”处可访问

当我在“localhost/xyz frontend”访问前端时,它返回一个有效的HTML,其中包含我的应用程序的正确标题。但是所有的JavaScript和CSS文件都没有通过,我收到了一个301永久移动的所有资源。我已经尝试将index.html中的base href设置为“/xyz frontend/”,但在404s中也解决了这个问题

现在我不知道我还能做什么,你们中的任何人

谢谢和问候