Error in nginx config with Docker
See original GitHub issueRecently found this project, excited to give it a try for a NFP I am working on. 😃
Description of the issue
There seems to be an error with the current nginx config when deploying on production according to the documentation. I’m pretty experienced with docker so I don’t think I’m doing anything dumb.
frontend_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
frontend_1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
frontend_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
frontend_1 | 2022/03/15 04:12:36 [emerg] 1#1: invalid variable name in /etc/nginx/nginx.conf:37
frontend_1 | nginx: [emerg] invalid variable name in /etc/nginx/nginx.conf:37
xx_frontend_1 exited with code 1
Context information (for bug reports)
Latest version of docker and docker-compose running on ubunu.
Steps to reproduce the issue
- Download repo with git
2.
docker-compose -f compose.yaml -f overrides/compose.erpnext.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.https.yaml config > ~/app/erpnext/docker-compose.yml
docker-compose --project-name xx -f ~/app/erpnext/docker-compose.yml up
nginx.conf as extracted from container
docker run -it frappe/erpnext-nginx:v13.22.1 cat -n /etc/nginx/nginx.conf
1
2 worker_processes auto;
3
4 error_log /var/log/nginx/error.log notice;
5 pid /tmp/nginx.pid;
6
7
8 events {
9 worker_connections 1024;
10 }
11
12
13 http {
14 proxy_temp_path /tmp/proxy_temp;
15 client_body_temp_path /tmp/client_temp;
16 fastcgi_temp_path /tmp/fastcgi_temp;
17 uwsgi_temp_path /tmp/uwsgi_temp;
18 scgi_temp_path /tmp/scgi_temp;
19
20 include /etc/nginx/mime.types;
21 default_type application/octet-stream;
22
23 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
24 '$status $body_bytes_sent "$http_referer" '
25 '"$http_user_agent" "$http_x_forwarded_for"';
26
27 access_log /var/log/nginx/access.log main;
28
29 sendfile on;
30 #tcp_nopush on;
31
32 keepalive_timeout 65;
33
34 #gzip on;
35
36 include /etc/nginx/conf.d/*.conf;
37 }
Stacktrace / full error message if available
db_1 | 2022-03-15 04:12:29+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
db_1 | 2022-03-15 04:12:29+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1 | 2022-03-15 04:12:29+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
db_1 | 2022-03-15 04:12:29+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
db_1 | 2022-03-15 4:12:29 0 [Note] mariadbd (server 10.6.7-MariaDB-1:10.6.7+maria~focal) starting as process 1 ...
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Number of pools: 1
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
db_1 | 2022-03-15 4:12:30 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Completed initialization of buffer pool
xx_configurator_1 exited with code 0
frontend_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
frontend_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/frappe-entrypoint.sh
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: 128 rollback segments are active.
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: 10.6.7 started; log sequence number 42575; transaction id 14
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2022-03-15 4:12:30 0 [Note] Plugin 'FEEDBACK' is disabled.
frontend_1 | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
db_1 | 2022-03-15 4:12:30 0 [Note] InnoDB: Buffer pool(s) load completed at 220315 4:12:30
db_1 | 2022-03-15 4:12:30 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
db_1 | 2022-03-15 4:12:30 0 [Note] Server socket created on IP: '0.0.0.0'.
db_1 | 2022-03-15 4:12:30 0 [Note] Server socket created on IP: '::'.
db_1 | 2022-03-15 4:12:30 0 [Note] mariadbd: ready for connections.
db_1 | Version: '10.6.7-MariaDB-1:10.6.7+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
redis_1 | 1:C 15 Mar 2022 04:12:29.470 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 15 Mar 2022 04:12:29.470 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 15 Mar 2022 04:12:29.470 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1 | 1:M 15 Mar 2022 04:12:29.470 * monotonic clock: POSIX clock_gettime
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * Running mode=standalone, port=6379.
redis_1 | 1:M 15 Mar 2022 04:12:29.474 # Server initialized
redis_1 | 1:M 15 Mar 2022 04:12:29.474 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * Loading RDB produced by version 6.2.6
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * RDB age 81 seconds
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * RDB memory usage when created 0.80 Mb
redis_1 | 1:M 15 Mar 2022 04:12:29.474 # Done loading RDB, keys loaded: 10, keys expired: 0.
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * DB loaded from disk: 0.000 seconds
redis_1 | 1:M 15 Mar 2022 04:12:29.474 * Ready to accept connections
frontend_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
frontend_1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
frontend_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
frontend_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
frontend_1 | 2022/03/15 04:12:36 [emerg] 1#1: invalid variable name in /etc/nginx/nginx.conf:37
frontend_1 | nginx: [emerg] invalid variable name in /etc/nginx/nginx.conf:37
xx_frontend_1 exited with code 1
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Nginx error in a docker container
I have a flask app that I'm trying to run in a docker container. Docker-compose build and docker-compose up both run fine, but...
Read more >open() "/etc/nginx/nginx.conf" failed (2: No such file or ...
Hi, I have a problem on my basic configuration with my environment with nginx,mysql,wordpress,mediawiki (local on Windows 10 PC).
Read more >How to Deploy an NGINX Image with Docker
This post explains how to: Deploy NGINX Open Source using the image from Docker Hub; Manage NGINX in the container (connecting to, configuring, ......
Read more >Nginx container returning an error with Exit code 1 [emerg] ...
... "enable" in /etc/nginx/nginx.conf:45. Posted on June 14, 2021; NginxDockerServer Optimization. cihatsaman Asked by cihatsaman. I have 2 servers one is ...
Read more >Docker nginx ssl error
You are copying the certificate files and the nginx config in the api container. You need to mount the files in the nginx...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue comes up if you use docker-compose v1. On second version everything works fine. There’s no universal solution: v1 requires “$host”, v2 — “$$host”.
Ahh, now I get it. It’s been a big week and I’m a little slow. Thanks for helping me understand.
On Fri, 18 Mar 2022, 10:57 pm Jonas Weigand, @.***> wrote: