Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1681 closed defect (wontfix)

Default_type

Reported by: Olaf van der Spek Owned by:
Priority: minor Milestone:
Component: other Version: 1.15.x
Keywords: Cc:
uname -a: Linux unstable 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.14.1
built with OpenSSL 1.1.1 11 Sep 2018 (running with OpenSSL 1.1.1a 20 Nov 2018)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-DqItAQ/nginx-1.14.1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --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 --modules-path=/usr/lib/nginx/modules --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-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-DqItAQ/nginx-1.14.1/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-DqItAQ/nginx-1.14.1/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-DqItAQ/nginx-1.14.1/debian/modules/http-echo --add-dynamic-module=/build/nginx-DqItAQ/nginx-1.14.1/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-DqItAQ/nginx-1.14.1/debian/modules/http-subs-filter

Description

docs:
Default: default_type text/plain;

nginx.conf: default_type application/octet-stream;

  1. IMO the stock conf file shouldn't deviate from the default.
  2. I think the default is wrong, if nginx doesn't know the type it shouldn't send the type.

Change History (9)

comment:1 by Olaf van der Spek, 6 years ago

Same for keepalive_timeout.

comment:2 by Maxim Dounin, 6 years ago

Resolution: wontfix
Status: newclosed

Thank you for your suggestion. You can use default_type applicatin/octet-stream; in your configuration if you think it is better thing to use, and this is what actually example configuration as shipped with nginx does right after defining common types:

http {
    include       mime.types;
    default_type  application/octet-stream;

While application/octet-stream might be a safer option, using text/plain by default is also a quite reasonable choice, given that to make application/octet-stream usable in practice you have to define common types anyway. I don't think we have to change the default.

As for the keepalive_timeout, the default is 75s, and this is what most installations would normally use unless there are good reasons to use other values.

comment:3 by Olaf van der Spek, 6 years ago

and this is what most installations would normally use

Then why does the 'example' nginx.conf contain these lines?

#keepalive_timeout 0;
keepalive_timeout 65;

comment:4 by Maxim Dounin, 6 years ago

Because one of the goals of the example configuration is to show how to tune various important parameters.

comment:5 by Olaf van der Spek, 6 years ago

So that file isn't supposed to be used as the stock conf for nginx?

comment:6 by Maxim Dounin, 6 years ago

It is. And one of the goals of any stock conf is to show how to tune various important parameters.

comment:7 by Olaf van der Spek, 6 years ago

Having two different nginx defaults is confusing..

comment:8 by Olaf van der Spek, 6 years ago

As for the keepalive_timeout, the default is 75s, and this is what most installations would normally use unless there are good reasons to use other values.

This isn't actually true right, if most installations are using the stock nginx.conf?

in reply to:  8 comment:9 by Maxim Dounin, 6 years ago

This isn't actually true right, if most installations are using the stock nginx.conf?

The example value as in the stock nginx.conf is practically the same.

Note: See TracTickets for help on using tickets.