Skip to content

Running 'nginx -s reload' within container yields error #11

@KWottrich

Description

@KWottrich

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

When I run nginx -s reload within the container, it should reload the config files without requiring a restart of nginx or the container.

Current Behavior

Running nginx -s reload yields the following error: open() "/run/nginx/nginx.pid" failed (2: No such file or directory).
It looks like this is because the default nginx.conf sets the PID location to /run/nginx.pid, but running nginx -V shows that it's expecting the PID to be at /run/nginx/nginx.pid. This is probably a matter of either adding mkdir /run/nginx to the dockerfile and changing the default nginx.conf to point to the new location, or recompiling nginx to expect the PID at /run/nginx.pid.

Steps to Reproduce

  1. Pull the latest SWAG docker image from dockerhub
  2. Start up a container
  3. Run docker exec -it <container_name> nginx -s reload

Environment

OS: Ubuntu 20.04.1
CPU architecture: x86_64
How docker service was installed: Add official Docker repo, installed through Apt (followed instructions at https://docs.docker.com/engine/install/ubuntu/)

Command used to create docker container (run/create/compose/screenshot)

docker-compose.yaml:

version: "2.4"
services:
  gateway:
    image: linuxserver/swag
    container_name: gateway
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - URL=my.domain
      - SUBDOMAINS=wildcard
      - VALIDATION=dns
      - DNSPLUGIN=cloudflare
      - EMAIL=my.email@gmail.com
    volumes:
      - /srv/gateway:/config
    ports:
      - 443:443
      - 80:80
    restart: unless-stopped

Docker logs

swag.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions