nginx: [warn] and [emerg] | config failed
kenetik opened this issue · 7 comments
nginx: [warn] server name "$scheme://stats.example.com$request_uri" has suspicious symbols in /etc/nginx/sites-enabled/stats.example.com:15
nginx: [emerg] "expires" directive is duplicate in /etc/nginx/apps/piwik/proxy_piwik_cache.conf:30
nginx: configuration file /etc/nginx/nginx.conf test failed
*Note: I put stats.example back in for privacy reasons.
I get similar errors in nginx:
2014/12/08 06:57:42 [emerg] 27600#0: "expires" directive is duplicate in /etc/nginx/apps/piwik/proxy_piwik_cache.conf:30
After commenting out the duplicate entry, the new error is:
2014/12/08 06:59:32 [emerg] 27637#0: "proxy_cache" zone "proxycache" is unknown in /etc/nginx/nginx.conf:133
If I comment out include apps/piwik/proxy_piwik_long_cache.conf;
in apps/piwik/piwik.conf, nginx then successfully loads, but the piwik setup pages are broken, generally missing images and css. I'm not quite following where the various caches flow in order to fix the issue
this is using the stock nginx 1.4.6 on ubuntu 14.04
Same issue here also.
same here. does anybody got it to work?
you must disable the proxy cache:
vi /etc/nginx/apps/piwik/piwik.conf
location = /index.php {
fastcgi_pass phpcgi;
## FastCGI cache.
## cache ui for 5m (set the same interval of your crontab)
include apps/piwik/fcgi_piwik_cache.conf;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
### Use the proxy cache if proxying to Apache.
#include apps/piwik/proxy_piwik_cache.conf; <---
}
When I disable the proxy cache, I then get:
nginx: [emerg] "fastcgi_cache" zone "fcgicache" is unknown in /etc/nginx/nginx.conf:41
nginx: configuration file /etc/nginx/nginx.conf test failed
I am using Debian 7.8, nginx 1.6.2
Just got it issue on Ubuntu 14.04 and nginx 1.4.6-1ubuntu.
Workaround:
- Disable the proxy cache as #13 (comment)
- Add your domain to valid referers if you are missing css and images:
diff --git a/apps/piwik/piwik.conf b/apps/piwik/piwik.conf
index 71609c7..1cc3fd4 100644
--- a/apps/piwik/piwik.conf
+++ b/apps/piwik/piwik.conf
@@ -6,7 +6,7 @@ location / {
## Disallow any usage of piwik assets if referer is non valid.
location ~* ^.+.(?:css|gif|html?|jpe?g|js|png|swf)$ {
## Defining the valid referers.
valid_referers none blocked *.mysite.com othersite.com;
valid_referers none blocked *.mysite.com othersite.com your.piwik.domain.here.; if ($invalid_referer) { return 444; }
cc @vacri
Even i know that this conversation is a couple of years old: I have same problem here and the workaround explained above does not work for me. I use nginx with php7.0-fpm, so i commented all the proxy configuration (longcache and cache), entered my domain into the valid referers and created a direcory /var/cache/fcgicache owned by www-data.
As ghost
mensioned, i get same error:
nginx: [emerg] "fastcgi_cache" zone "fcgicache" is unknown in /etc/nginx/nginx.conf:64
Any other ideas?