linuxserver / docker-letsencrypt

DEPRECATED: Please use linuxserver/swag instead
GNU General Public License v3.0
722 stars 172 forks source link

nginx is not compiled with "--with-debug" #476

Closed midzelis closed 4 years ago

midzelis commented 4 years ago

nginx -V 2>&1 | grep -- '--with-debug'

This makes is really hard to debug new nginx configurations.

nemchik commented 4 years ago

We install nginx from alpine's repos. https://github.com/linuxserver/docker-letsencrypt/blob/3defc1d7ad28fc4799ff162fa8af549831d66066/Dockerfile#L23-L28 (note the first and last line in this snip, nginx is installed via alpine's package manager apk from the alpine repos) We do not compile nginx. You may be able to accomplish this via a docker-mod or container customization, but that sounds like the kind of change you might want to just make a fork for.

aptalca commented 4 years ago

@midzelis this is what you're looking for: https://pkgs.alpinelinux.org/package/v3.12/main/x86_64/nginx-debug

midzelis commented 4 years ago

I was able to workaround by using the official nginx docker image, which comes with a nginx-debug binary. For debugging, I created a this docker-compose-debug.yml file, which loads the same config as this Dockerfile, except I had to comment out lua_load_resty_core off; statement in nginx.conf, as this is not valid in the official image.

Posting this config here, in case it helps other people trying to debug nginx configs.

version: "3"
services:
  letsencrypt-debug:
    image: nginx
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New York
    volumes:
      - ./config:/config:rw
      - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - 443:443
      - 80:80 #optional
    restart: always
    command: [nginx-debug]