Public bug reported:

Current nginx build is ignoring prefix path and tries to write to some
compiled-in path.

shadowlmd@ubuntu-server-latest:~$ sudo rmdir /var/lib/nginx/*

shadowlmd@ubuntu-server-latest:~$ nginx -p $HOME/nginx -c 
$HOME/nginx/nginx.conf -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" 
failed (13: Permission denied)
nginx: the configuration file /home/shadowlmd/nginx/nginx.conf syntax is ok
2020/10/09 12:38:03 [emerg] 2702#2702: mkdir() "/var/lib/nginx/body" failed 
(13: Permission denied)
nginx: configuration file /home/shadowlmd/nginx/nginx.conf test failed

shadowlmd@ubuntu-server-latest:~$ cat $HOME/nginx/nginx.conf
events {
    worker_connections  10;
}
error_log         error.log info;
pid               nginx.pid;
http {
    access_log    access.log  combined;
    server {
        listen        127.0.0.1:8123;
        location / {
            return 200 "hello\n";
        }
    }
}

This is happening because of compile time these options:
--error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock 
--pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules 
--http-client-body-temp-path=/var/lib/nginx/body 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
--http-proxy-temp-path=/var/lib/nginx/proxy 
--http-scgi-temp-path=/var/lib/nginx/scgi 
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi

If nginx is built without them, everything works perfectly.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: nginx 1.18.0-0ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri Oct  9 12:31:44 2020
InstallationDate: Installed on 2020-02-04 (248 days ago)
InstallationMedia: Ubuntu-Server 19.10 "Eoan Ermine" - Release amd64 (20191017)
PackageArchitecture: all
ProcEnviron:
 TERM=screen.xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nginx
UpgradeStatus: Upgraded to focal on 2020-06-29 (102 days ago)

** Affects: nginx (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1899164

Title:
  nginx ignores prefix path

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1899164/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to