zoukankan      html  css  js  c++  java
  • 错误提示 nginx: [emerg] unknown directive "gzip_static"

     1、检查nginx配置文件错误提示如下:

    [root@server nginx]# /applications/nginx/sbin/nginx -t -c /applications/nginx/nginx/nginx.conf
    nginx: [emerg] unknown directive "gzip_static" in /applications/nginx/nginx/inc/gzip.conf:4
    nginx: configuration file /applications/nginx/nginx/nginx.conf test failed
    

    2、查看nginx的编译参数

    [root@server nginx]# /applications/nginx/sbin/nginx -V
    nginx version: nginx/1.6.0
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) 
    TLS SNI support enabled
    configure arguments: --user=www --group=www --add-module=../ngx_cache_purge-1.3/ --prefix=/applications/nginx-1.6.0 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module
    

     3、解决方式,重新编译、安装nginx,增加--with-http_gzip_static_module参数

     
    [root@server nginx-1.6.0]# ./configure --user=www --group=www --add-module=../ngx_cache_purge-1.3/ --prefix=/applications/nginx-1.6.0 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
    [root@server nginx-1.6.0]# make && make install
    

      

     
  • 相关阅读:
    NFS-heartbeat-drbd模拟NFS高可用
    drbd
    hearbeat
    ldap
    SVN
    Nginx负载均衡
    shell-day1
    angularJS(二):作用域$scope、控制器、过滤器
    angularJS(一):表达式、指令
    nodejs、npm、 typescript、angular-cli安装
  • 原文地址:https://www.cnblogs.com/xzlive/p/9145473.html
Copyright © 2011-2022 走看看