G
G
georgich2022-02-02 14:28:56
Nginx
georgich, 2022-02-02 14:28:56

How to fix 503 error in nginx-proxy Docker?

Greetings!
I am using these images:
https://hub.docker.com/r/jwilder/nginx-proxy
https://hub.docker.com/_/php/
Here is my docker-compose.yml file:

version: "3.9"
services:
  web:
    image: php:7.4-apache
    container_name: web
    restart: always
    volumes:
      - ./:/var/www/html
      - /srv/www/logs/apache2:/var/log/apache2

  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    restart: always
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
    ports:
      - "80:80"
      - "443:443"
    links:
        - web

I am getting 503 error. Tell me, please, what am I doing wrong? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2022-02-02
@q2digger

Well, first you need to take and carefully read the jwilder/nginx-proxy documentation.
Where are your environment variables set? Here is an example from the docs:


whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.local

PS links are not needed in docker-compose, it links them by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question