linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
762 stars 108 forks source link

NGINX invalid number of arguments in server_name directive #110

Closed kale1d0code closed 2 years ago

kale1d0code commented 2 years ago

linuxserver.io

nginx will not start listening on port 80 within the container due to an issue with a configuration file found at /config/nginx/site-confs/default:4 checking out the configuration file, the server_name value is empty

server_name ;

mounting an empty folder at /config causes error messages about missing config files. don't know how to get nginx to ignore the /config folder and read from /etc/nginx like normal


Expected Behavior

start the container without issues

Current Behavior

nginx does not start listening on port 80 when container starts

Steps to Reproduce

  1. download example docker-compose file
  2. start stack and attempt to reach bookstack

Environment

OS: Centos 7 CPU architecture: x86_64 How docker service was installed: yum offical repo

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

version: "3"

networks:
  proxy:
    external: true
  db:
    external: true

volumes:
  bookstack_data:

secrets:
  db_pass:
    file: '/<LOCATION>/bookstack_db_pass.txt'

services:
  bookstack:
    image: linuxserver/snipe-it:latest
    container_name: bookstack
    restart: always
    volumes:
      - bookstack_data:/config
    labels:
      - 'traefik.enable=true'
      - 'traefik.docker.network=proxy'
      - 'traefik.http.routers.bookstack.rule=Host(`<URL>`)'
      - 'traefik.http.routers.bookstack.entrypoints=websecure,web'
      - 'traefik.http.routers.bookstack.tls=true'
      - 'traefik.http.routers.bookstack.tls.certresolver=default'
      - 'traefik.http.services.bookstack.loadbalancer.server.port=80'
    environment:
      - 'MYSQL_DATABASE=bookstack'
      - 'MYSQL_USER=bookstack'
      - 'FILE__MYSQL_PASSWORD=/run/secrets/db_pass'
    secrets:
      - db_pass
    expose:
      - 80
    networks:
      - proxy
      - db
    external_links:
      - dbms

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.

[s6-init] ensuring user provided files have correct perms...exited 0.

[fix-attrs.d] applying ownership & permissions fixes...

[fix-attrs.d] done.

[cont-init.d] executing container initialization scripts...

[cont-init.d] 01-envfile: executing...

[env-init] MYSQL_PASSWORD set from FILE__MYSQL_PASSWORD

[cont-init.d] 01-envfile: exited 0.

[cont-init.d] 10-adduser: executing...

usermod: no changes


      _         ()

     | |  ___   _    __

     | | / __| | |  /  \ 

     | | \__ \ | | | () |

     |_| |___/ |_|  \__/

Brought to you by linuxserver.io


To support the app dev(s) visit:

Snipe-IT: https://snipeitapp.com/donate

To support LSIO projects visit:

https://www.linuxserver.io/donate/


GID/UID


User uid: 911

User gid: 911


[cont-init.d] 10-adduser: exited 0.

[cont-init.d] 20-config: executing...

[cont-init.d] 20-config: exited 0.

[cont-init.d] 30-keygen: executing...

using keys found in /config/keys

[cont-init.d] 30-keygen: exited 0.

[cont-init.d] 40-config: executing...

[cont-init.d] 40-config: exited 0.

[cont-init.d] 90-custom-folders: executing...

[cont-init.d] 90-custom-folders: exited 0.

[cont-init.d] 99-custom-files: executing...

[custom-init] no custom files found exiting...

[cont-init.d] 99-custom-files: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

nginx: [emerg] invalid number of arguments in "server_name" directive in /config/nginx/site-confs/default:4

github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 2 years ago

You're missing a required env var

kale1d0code commented 2 years ago

You're missing a required env var

I also used the wrong image :)