docker-tutorial: 403 forbidden

Hi, I am following your blog post. http://tech.osteel.me/posts/2015/12/18/from-vagrant-to-docker-how-to-use-docker-for-local-web-development.html

I got the first step - welcome to nginx.

on the second step, i get…

403 Forbidden
nginx/1.11.3

Can you help?

thanks in advance!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Here’s a potential solution:

I am actually not using this repo – but I ran into the same problem as the other person. I got mine working. I’m using an identical nginx/default.conf – nothing fancy.

FROM nginx:latest

COPY ./default.conf /etc/nginx/conf.d/default.conf
mariadb:
  image: mariadb:latest
  volumes_from:
    - mariadb_data
  environment:
    MYSQL_ROOT_PASSWORD: secret
    MYSQL_DATABASE: project
    MYSQL_USER: project
    MYSQL_PASSWORD: project
  expose:
    - 3306

mariadb_data:
  image: tianon/true
  volumes:
    - /var/lib/mariadb

nginx:
  build: ./.build/docker/nginx/
  ports:
      - 80:80
  links:
    - php
  volumes:
    - ./web:/var/www/html

php:
  build: ./.build/docker/php/
  expose:
    - 9000
  links:
    - mariadb
  volumes:
    - ./web:/var/www/html

Here’s the fix: Don’t try to hit localhost when the directory is empty.

Here’s the error I get:

2017/02/09 05:46:48 [error] 7#7: *2 directory index of “/var/www/html/” is forbidden, client: 172.17.0.1, server: , request: “GET / HTTP/1.1”, host: “localhost”

Once I added index.php – drop in a phpinfo(): PHP Version 7.0.14

All gravy.

I hope this helps the previous guy and future people who might stumble on this result.