i have a mono-repo angular project with two angular apps and i have copied dist folders like below
COPY dist/app1/ /usr/share/nginx/html
COPY dist/app2/ /usr/share/nginx/html
nginx conf
server {
listen 8002;
root /usr/share/nginx/html/app1;
expires $expires;
location ~ \.[a-z]*$ {
}
location / {
try_files $uri$args $uri$args/ /index.html =404;
add_header file-served index;
}
}
server {
listen 8003;
root /usr/share/nginx/html/app2;
expires $expires;
location ~ \.[a-z]*$ {
}
location / {
try_files $uri$args $uri$args/ /index.html =404;
add_header file-served index;
}
}
But while running docker image I am receiving the error below like this
docker run -p 8020:8002 -p 8021:8003 d6b
[error] 7#7: *1 directory index of "/usr/share/nginx/html/app1/" is forbidden, client: 172.17.0.1, server: , request: "GET / HTTP/1.1", host: "localhost:8020"
[error] 7#7: *2 directory index of "/usr/share/nginx/html/app2/" is forbidden, client: 172.17.0.1, server: , request: "GET / HTTP/1.1", host: "localhost:8021"