Olá,
Ao tentar rodar um site estático num container nginx recebo a mensagem de 403 Forbidden e minha url muda de http://localhost:12345
para http://localhost:12345/pages/index.html
.
Comando:
sudo docker run -p 12345:80 -v ~/tmp/bootstrap-admin-panel:/usr/share/nginx/html nginx
Log do terminal:
172.17.0.1 - - [21/Dec/2018:13:08:11 +0000] "GET / HTTP/1.1" 200 290 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0" "-"
172.17.0.1 - - [21/Dec/2018:13:08:11 +0000] "GET /pages/index.html HTTP/1.1" 403 153 "http://localhost:12345/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0" "-"
2018/12/21 13:08:11 [error] 8#8: *1 open() "/usr/share/nginx/html/pages/index.html" failed (13: Permission denied), client: 172.17.0.1, server: localhost, request: "GET /pages/index.html HTTP/1.1", host: "localhost:12345", referrer: "http://localhost:12345/"
Por que ocorre e como contornar?