I'm testing Jwilder nginx-proxy custom nginx configuration using this command:
version: "3.8"
services:
reverse-proxy:
image: "jwilder/nginx-proxy:latest"
container_name: "reverse-proxy"
volumes:
- "html:/usr/share/nginx/html"
- "dhparam:/etc/nginx/dhparam"
- "vhost:/etc/nginx/vhost.d"
- "certs:/etc/nginx/certs"
- "/run/docker.sock:/tmp/docker.sock:ro"
- "PATH_TO/conf/myconf.conf:/etc/nginx/conf.d/myconf.conf:ro"
restart: "always"
networks:
- "net"
ports:
- "80:80"
- "443:443"
letsencrypt:
image: "jrcs/letsencrypt-nginx-proxy-companion:latest"
container_name: "letsencrypt-helper"
volumes:
- "html:/usr/share/nginx/html"
- "dhparam:/etc/nginx/dhparam"
- "vhost:/etc/nginx/vhost.d"
- "certs:/etc/nginx/certs"
- "/run/docker.sock:/var/run/docker.sock:ro"
environment:
NGINX_PROXY_CONTAINER: "reverse-proxy"
DEFAULT_EMAIL: "user@domain.com"
restart: "always"
depends_on:
- "reverse-proxy"
networks:
- "net"
volumes:
certs:
html:
vhost:
dhparam:
networks:
net:
external: true
this part doesn't seem to work
"PATH_TO/conf/myconf.conf:/etc/nginx/conf.d/myconf.conf:ro"
I have this error
nginx: [emerg] open() "/etc/nginx/security-headers-ssl.conf"
failed (2: No such file or directory) in /etc/nginx/conf.d/myconf.conf:34
I also tried adding custom config directly via the below, but it also didn't work.
docker cp PATH_TO/conf/myconf.conf reverse-proxy:/etc/nginx/conf.d/