Nginx服务器基本的模块配置和使用全攻略

2019-10-17 19:30:17刘景俊

autoindex_exact_size off; 默认为on,显示出文件的确切大小,单位是bytes。改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
autoindex_localtime on;
默认为off,显示的文件时间为GMT时间。改为on后,显示的文件时间为文件的服务器时间

location /images {
 root  /var/www/nginx-default/images;
 autoindex on;
 autoindex_exact_size off;
 autoindex_localtime on;
 }


3.添加nginx模块时如何进行调试?
自己添加nginx模块时难免会出现错误,因此需要做好必要的调试工作。
直接运行gdb nginx 会出现:No symbol table info available。

编译时 加入 CFLAGS="-g -O0"

./configure --prefix=/usr/local/server/nginx --with-cc-opt="-I /usr/include/pcre -I /usr/include/openssl" --with-debug --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_ssl_module --with-http_perl_module --with-http_stub_status_module

然后:

make
make install