# Docker Nginx-proxy Durpal

**URL:** <https://forums.docker.com/t/docker-nginx-proxy-durpal/43847>\
**Category:** Compose\
**Created:** [January 4, 2018, 9:04pm UTC](https://forums.docker.com/t/docker-nginx-proxy-durpal/43847 "2018-01-04T21:04:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![runa68](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@runa68](https://forums.docker.com/u/runa68)\
**Post date:** [January 4, 2018, 9:04pm UTC](https://forums.docker.com/t/docker-nginx-proxy-durpal/43847/1 "2018-01-04T21:04:50Z")

</div>

Hello i have a problem with my docker-compose

I use nginx-proxy and nginx-proxy-compagnion to have multiple sites on the same vps and for the automatic ssl.

After a lot of testing, I installed nginx as a web server to run Drupal.

The problem nothing works …  
Neither the database nor the Drupal files etc …

I can not find where the problem comes from !!  
I’m on the brink of removing all this and make my server by hand!

Thank you for your help !

> version: ‘2’
> 
> ```
> services:
> nginx-proxy:
> restart: always
> image: jwilder/nginx-proxy
> ports:
> - "80:80"
> - "443:443"
> volumes:
> - /srv/docker/nginx/certs:/etc/nginx/certs:ro
> - /etc/nginx/vhost.d
> - /usr/share/nginx/html
> - /var/run/docker.sock:/tmp/docker.sock:ro
> 
> nginx-proxy-companion:
> image: jrcs/letsencrypt-nginx-proxy-companion
> volumes:
> - /srv/docker/nginx/certs:/etc/nginx/certs:rw
> - /var/run/docker.sock:/var/run/docker.sock
> volumes_from:
> - nginx-proxy
> 
> web:
> image: nginx
> volumes:
> - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
> - /var/www/html
> links: 
> - nginx-proxy
> - php
> ports:
> - "8080:8080"
>     
> php:
> image: php:7-fpm
> ports:
> - "9000:9000"
> 
> drupal:
> image: drupal:8.4-fpm
> volumes:
> - /var/www/html/modules
> - /var/www/html/profiles
> - /var/www/html/themes
> - /var/www/html/sites/default/files
> restart: always
> links:
> - mysql
> - web
> environment:
> - VIRTUAL_HOST=les-decouvertes-de-runa.fr
> - LETSENCRYPT_HOST=les-decouvertes-de-runa.fr
> - LETSENCRYPT_EMAIL=les-decouvertes-de-runa.fr
> 
> mysql:
> image: mysql
> ports:
> - "3306:3306"
> environment:
> - MYSQL_PASSWORD=mdp
> - MYSQL_USER=user
> - MYSQL_DATABASE=database
> - MYSQL_ROOT_PASSWORD=mdproot
> restart: always
> volumes:
> - /opt/mysql_data:/var/lib/mysql
> 
> ```

---

<div class="post-metadata">

**Author:** ![arikin](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@arikin](https://forums.docker.com/u/arikin)\
**Post date:** [May 16, 2018, 5:02am UTC](https://forums.docker.com/t/docker-nginx-proxy-durpal/43847/2 "2018-05-16T05:02:16Z")

</div>

You have the VIRTUAL\_HOST environment set for drupal but you need to expose the port(s) for drupal.

```
services:
  drupal:
    expose:
      - 80
      - 443

```

Then at the bottom add a network all can use:

```
networks:
  default:
    external:
      name: nginx-proxy

```

But that means you setup the external network from the command line.

```
$ docker network create nginx-proxy

```

Taken from experience and this website: [Multiple websites](https://blog.ssdnodes.com/blog/tutorial-using-docker-and-nginx-to-host-multiple-websites/)
