Opened 5 years ago

Closed 5 years ago

#1956 closed defect (invalid)

duplicate requests in ssl environments when favicon is enabled

Reported by: medeirosinacio@… Owned by:
Priority: minor Milestone: nginx-1.17
Component: documentation Version: 1.17.x
Keywords: Cc: medeirosinacio@…
uname -a:
nginx -V: nginx version: nginx/1.17.10
built by gcc 9.2.0 (Alpine 9.2.0)
built with OpenSSL 1.1.1d 10 Sep 2019
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-perl_modules_path=/usr/lib/perl5/vendor_perl --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-Os -fomit-frame-pointer' --with-ld-opt=-Wl,--as-needed

Description

I was testing a page in "index.php", where it simply creates a file.

The problem is that in SSL the request was always duplicated, any https request generated 2 files instead of one. After testing, I saw that directing to page 404 also generated a file.

How does Nginx's standard 404 error generate a file that my index.php creates?

After testing, adding the line:

location = /favicon.ico {

log_not_found off;

}

I noticed that the problem was resolved. This problem does not occur in http environments, only when https is configured.

What I noticed in the tests, is that the standard favicon call also calls the configured root file, such as index.php. Any request to the server, whether 404, 200 also calls the favicon and with it index.php.

The standard favicon call in ssl environments duplicates the request by calling the doccument root.

Change History (1)

comment:1 by Maxim Dounin, 5 years ago

Resolution: invalid
Status: newclosed

Symptoms you describe suggest that you have error_page 404 configured, likely in location / (or in different location where /favicon.ico was handled before your configuration changes), and it is further directed to your index.php script, causing another file to be generated.

If you need further help with configuring nginx, consider using support options available.

Note: See TracTickets for help on using tickets.