Nginx配置错误,Google了一遍又一遍,就是没有相似的错误和解决办法...这个错误真是奇葩了啊,大牛帮忙看看是怎么回事?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Nginx配置错误,Google了一遍又一遍,就是没有相似的错误和解决办法...这个错误真是奇葩了啊,大牛帮忙看看是怎么回事?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3764字,纯文字阅读大概需要6分钟。
内容图文
nginx配置文件如下:worker_processes 1;
worker_rlimit_nofile 65535;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
error_log logs/error.log crit;
pid logs/nginx.pid;
events {
worker_connections 65535;
multi_accept on;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
access_log off;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 10;
client_header_timeout 10;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 10;
gzip on;
gzip_min_length 1024;
gzip_buffers 4 16k;
#gzip_http_version 1.1;
gzip_comp_level 2;
fastcgi_cache_path /usr/local/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_cache TEST;
fastcgi_cache_valid 200 302 1h;
fastcgi_cache_valid 301 1d;
fastcgi_cache_valid any 1m;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
server {
listen 80 default;
server_name _;
return 403;
}
include /usr/local/nginx/conf/vhosts/*.conf;
测试Nginx 得到如下错误信息:
[root@test conf]# /usr/local/nginx/sbin/nginx -t
nginx: [emerg] unknown directive "fastcgi_cache_path" in /usr/local/nginx/conf/nginx.conf:46
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
回复内容:
nginx配置文件如下:
worker_processes 1;
worker_rlimit_nofile 65535;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
error_log logs/error.log crit;
pid logs/nginx.pid;
events {
worker_connections 65535;
multi_accept on;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
access_log off;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 10;
client_header_timeout 10;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 10;
gzip on;
gzip_min_length 1024;
gzip_buffers 4 16k;
#gzip_http_version 1.1;
gzip_comp_level 2;
fastcgi_cache_path /usr/local/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_cache TEST;
fastcgi_cache_valid 200 302 1h;
fastcgi_cache_valid 301 1d;
fastcgi_cache_valid any 1m;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
server {
listen 80 default;
server_name _;
return 403;
}
include /usr/local/nginx/conf/vhosts/*.conf;
测试Nginx 得到如下错误信息:
[root@test conf]# /usr/local/nginx/sbin/nginx -t
nginx: [emerg] unknown directive "fastcgi_cache_path" in /usr/local/nginx/conf/nginx.conf:46
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
你是怎么安装的nginx啊 configure怎么设置的 总感觉你的http_fastcgi_module
模块没有安装
你nginx -V 看下输出 是不是把他给without了啊
更新:
经题主测试 开启--with-http-cache后,fastcgi_cache可用
补充一下,Nginx版本是1.6.3,最新稳定版
内容总结
以上是互联网集市为您收集整理的Nginx配置错误,Google了一遍又一遍,就是没有相似的错误和解决办法...这个错误真是奇葩了啊,大牛帮忙看看是怎么回事?全部内容,希望文章能够帮你解决Nginx配置错误,Google了一遍又一遍,就是没有相似的错误和解决办法...这个错误真是奇葩了啊,大牛帮忙看看是怎么回事?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。