Opened 7 years ago

Closed 7 years ago

#1190 closed defect (invalid)

fastcgi_cache_path in site-available AND site-enabled cause error

Reported by: TheHades@… Owned by:
Priority: trivial Milestone:
Component: other Version: 1.6.x
Keywords: Cc:
uname -a: Linux node1.domain.tld 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
nginx -V:
nginx version: nginx/1.6.2
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-z,relro --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --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 --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_secure_link_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/headers-more-nginx-module --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-auth-pam --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-cache-purge --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-development-kit --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-echo --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/ngx-fancyindex --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-http-push --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-lua --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-upload-progress --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/nginx-upstream-fair --add-module=/build/nginx-AGNHOe/nginx-1.6.2/debian/modules/ngx_http_substitutions_filter_module

Description

Hello,

i've setup a fastcgi_cache_path for a wordpress site, but nginx keep saying, that the path is configured twice.

root@node1:/etc/nginx/fastcgi_snippets# nginx -t
nginx: [emerg] the same path name "/var/run/nginx-cache-web1" used in /etc/nginx/fastcgi_snippets/virtual.web1.conf:1 and in /etc/nginx/fastcgi_snippets/virtual.web1.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

root@node1:/etc/nginx/sites-enabled# nginx -t
nginx: [emerg] the same path name "/var/run/nginx-cache-web1" used in /etc/nginx/sites-enabled/virtual.web1.conf:1 and in /etc/nginx/sites-enabled/virtual.web1.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

/etc/nginx/sites-enabled is symlinked to /etc/nginx/sites-available/ .
Does NGINX check both config-files, although there is only one? (sites-available is only a symlink) ?

root@node1:/etc/nginx/fastcgi_snippets# ls -al /etc/nginx/sites-available/
insgesamt 28
drw------- 2 root root 4096 Jan 29 19:19 .
drw------- 7 root root 4096 Jan 29 19:17 ..
-rw-r--r-- 1 root root 1367 Jan 16 20:36 default
-rw-r--r-- 1 root root 1363 Jan 16 18:18 default.bak
-rw-r--r-- 1 root root 2250 Jan 29 19:19 virtual.web1.conf

root@node1:/etc/nginx/fastcgi_snippets# ls -al /etc/nginx/sites-enabled/
insgesamt 8
drw------- 2 root root 4096 Jan 29 19:17 .
drw------- 7 root root 4096 Jan 29 19:17 ..
lrwxrwxrwx 1 root root 26 Jan 28 15:37 default -> ../sites-available/default
lrwxrwxrwx 1 root root 36 Jan 29 19:16 virtual.web1.conf -> ../sites-available/virtual.web1.conf

root@node1:/etc/nginx/fastcgi_snippets# grep -R "fastcgi_cache_path" /etc/nginx/
/etc/nginx/fastcgi_snippets/virtual.web1.conf:fastcgi_cache_path /var/run/nginx-cache-web1 levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;

Or did i miss something?

Regardsm
Philipp

Change History (1)

comment:1 by Maxim Dounin, 7 years ago

Resolution: invalid
Status: newclosed

The only file nginx actually reads is the nginx.conf file. In your case it is located at /etc/nginx/nginx.conf. Anything else - that is, various sites-enabled and so on - is not something nginx reads by itself, but rather something it is configured to read within nginx.conf using the include directive.

The message as printed by nginx -t suggests that the virtual.web1.conf file is somehow included twice. Check your nginx.conf to see how this happens.

If you have further questions, please use the mailing list. Thank you.

Note: See TracTickets for help on using tickets.