Docker Community Forums

Share and learn in the Docker community.

ERROR: nginx and php


(Kevinsillo) #1

Hi, I have a nginx reverse server and two nginx, each with its web. One of only html works correctly and the other with php gives error 403 forbidden.

Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.17.1, build unknown

403 Forbidden

nginx/1.15.3

reverse_proxy:
  container_name: servidorWeb
  image: jwilder/nginx-proxy
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock:ro
  ports:
    - "80:80"
    - "443:443"
  networks:
    - webnet
nginx:
  container_name: pagina1
  image: nginx
  links:
    - php
  depends_on:
    - reverse_proxy
  environment:
    - VIRTUAL_HOST=killweb1.com
  volumes:
    - ./web1:/usr/share/nginx/html
    - ./default.conf:/etc/nginx/sites-available/default.conf
  networks:
    - webnet
nginx2:
  container_name: pagina2
  image: nginx
  links:
    - php
  depends_on:
    - reverse_proxy
  environment:
    - VIRTUAL_HOST=killweb2.com
  volumes:
    - ./web2:/usr/share/nginx/html
    - ./default.conf:/etc/nginx/sites-available/default.conf
  networks:
    - webnet
php:
  container_name: php
  image: php
  networks:
    - webnet

networks:
webnet: