我无法使用基本url访问dockerizedangular应用程序

我是docker工人。 我用这种方式整合了我的基础设 我在nginx镜像里敲了我的angular 4项目。 我也使用nginx作为angular度项目和api之间的反向代理。 我想访问我的应用程序使用URL http://localhost:9000/system但我只能做http://localhost:9000 。 运行这个之后

 docker run -p 9000:80 -dit nginx 

我试图构build我的angular度应用程序ng build --prod --base-href /system ,并更改<base href='/system'/> 。 它的工作在我的开发机器罚款,但是当我说唱内docker我只能访问http://localhost:9000 ,更糟糕的是,我刷新浏览器后无法访问应用程序。

Dockerfile

 # Set the base image to nginx FROM nginx COPY nginx /usr/share/nginx/html # Expose ports EXPOSE 80 

nginx.conf

 worker_processes 1; events { worker_connections 1024; use epoll; } http { include mime.types; default_type application/octet-stream; server { listen 80; server_name _; root pos; index index.html index.htm; location /api/service { # Preflighted requests if ($request_method = OPTIONS ) { add_header "Access-Control-Allow-Origin" *; add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD, PUT, DELETE"; add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Allow-Origin"; add_header "Access-Control-Max-Age" 1728000; #add_header "Access-Control-Allow-Credentials" true; add_header "Content-Type" "text/plain; charset=utf-8"; add_header "Content-Length" 0; return 204; } proxy_pass http://127.0.0.1:3000; }