Eu tenho um serviço de frota no arquivo nginx.service
que estou tentando iniciar no CoreOS:
[Unit]
Description=nginx
[Service]
User=core
TimeoutStartSec=0
EnvironmentFile=/etc/environment
ExecStartPre=-/usr/bin/docker stop nginx
ExecStartPre=-/usr/bin/docker rm nginx
ExecStart=/usr/bin/docker run --rm --name nginx -v /home/core/nginx/conf:/etc/nginx/conf:ro -p 80:80 nginx:latest
#
ExecStop=-/usr/bin/docker stop nginx
ExecStopPost=-/usr/bin/docker rm nginx
Restart=always
RestartSec=10s
[X-Fleet]
Quando eu inicio com fleetctl start nginx.service
, ele não mostra nenhum erro, mas na revista eu vejo isso quando tento visitar o site:
Aug 24 15:00:09 core-01 docker[2839]: 172.17.8.1 - - [24/Aug/2016:15:00:09 +0000] "GET / HTTP/1.1" 403 571 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" "-"
Aug 24 15:00:09 core-01 docker[2839]: 2016/08/24 15:00:09 [error] 5#5: *1 directory index of "/usr/share/nginx/html/" is forbidden, client: 172.17.8.1, server: localhost, request: "GET / HTTP/1.1", host: "172.17.8.101"
Aug 24 15:00:09 core-01 docker[2839]: 2016/08/24 15:00:09 [error] 5#5: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.8.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "172.17.8.101", referrer: "http://172.17.8.101/"
Aug 24 15:00:09 core-01 docker[2839]: 172.17.8.1 - - [24/Aug/2016:15:00:09 +0000] "GET /favicon.ico HTTP/1.1" 404 571 "http://172.17.8.101/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" "-"
Mas se eu iniciar o comando docker do arquivo de frota:
/usr/bin/docker run --rm --name nginx -v /home/core/nginx/conf:/etc/nginx/conf:ro -p 80:80 nginx:latest
Ele é executado corretamente e mostra as páginas corretas.
O que estou fazendo errado e como corrigi-lo?