I am setting my nginx reverse proxy server
with the docker-compose code below:
version: "3.8"
# !!make sure to put default.conf into /nginx/conf.d/ before running the stack.
services:
ng_proxy:
image: nginx:latest
restart: always
volumes:
- ~/nginx/public:/var/www/html
- ~/nginx/conf.d:/etc/nginx/conf.d
ports:
- 80:80
which I already have my default.conf
setup nicely in the ~/nginx/conf.d
folder.
but when i deploy it, I am getting a error 521
, which show host error
.
and the log:
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist *** <-- this is the suspicious line!!!
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/05/09 08:27:25 [notice] 1#1: using the "epoll" event method
2024/05/09 08:27:25 [notice] 1#1: nginx/1.25.5
2024/05/09 08:27:25 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)
2024/05/09 08:27:25 [notice] 1#1: OS: Linux 5.15.0-67-generic
2024/05/09 08:27:25 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/05/09 08:27:25 [notice] 1#1: start worker processes
2024/05/09 08:27:25 [notice] 1#1: start worker process 19
It seems like it cannot find the default.conf in ~/nginx/default.conf
.
What step do I missed out that I can solve this?