[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[NginX][maybeHS] Impossible de déclencher une erreur :



Au secours !

sur un mini-site que je viens de monter, je suis incapable d'obtenir une erreur dans mes logs.

Je suis servi par NginX.

J'ai monté mon site dans une home chez un nouvel user, comme je fais d'habitude.

Le site n'a qu'une page, des bricoles et désormais une page d'erreur que je viens de faire :
======================================================================
~# ls -all /home/USER/machintruc
total 136
drwxr-xr-x 2 USER www-data  4096 févr. 15 19:35 .
drwxr-xr-x 3 USER USER     4096 févr. 13 19:10 ..
-rw-r--r-- 1 USER www-data    62 févr. 15 19:35 404.html
-rw-rw-r-- 1 USER www-data  3029 févr. 14 00:52 apple-touch-icon.png
-rw-rw-r-- 1 USER www-data 18370 févr. 14 00:09 favicon.ico
-rw-rw-r-- 1 USER www-data  3263 févr. 13 19:54 index.html
-rw-rw-r-- 1 USER www-data 93106 févr. 13 19:54 jquery.js
-rw-rw-r-- 1 USER www-data    24 févr. 14 23:52 robots.txt
======================================================================
La page est réalisée en HTML strict, il y a juste un petit JS à l'intérieur pour faire une redirection.

J'essaye de provoquer une erreur, mais le fichier USER.error.log reste désespérément vide.

J'ai en revanche un code 200 pour cette erreur :
======================================================================
~# tail USER.access.log
XX.XXX.XXX.X - - [15/Feb/2015:18:31:03 +0100] "GET /d HTTP/1.1" 200 1576 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; fr) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/4.1.3 Safari/533.19.4" 66.249.91.61 - - [15/Feb/2015:18:31:50 +0100] "GET /d HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.77 - - [15/Feb/2015:18:56:37 +0100] "GET / HTTP/1.1" 403 141 "-" "Mediapartners-Google" XX.XXX.XXX.X - - [15/Feb/2015:18:56:43 +0100] "GET /c HTTP/1.1" 200 1576 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; fr) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/4.1.3 Safari/533.19.4" 66.249.91.77 - - [15/Feb/2015:18:57:28 +0100] "GET /c HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.61 - - [15/Feb/2015:19:00:44 +0100] "GET /d HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.77 - - [15/Feb/2015:19:16:54 +0100] "GET /d HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.61 - - [15/Feb/2015:19:22:06 +0100] "GET /d HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.101 - - [15/Feb/2015:19:37:27 +0100] "GET /x HTTP/1.1" 403 141 "-" "Mediapartners-Google" 66.249.91.93 - - [15/Feb/2015:19:39:36 +0100] "GET /x HTTP/1.1" 403 141 "-" "Mediapartners-Google"
======================================================================
J'ai bloqué exprès les crawlers, donc Big Brother se mange un bon 403, ça c'est ce que je voulais :-)

Le fait de ne pas avoir d'erreur m'arrange plutôt dans mon projet, mais j'aimerais bien en comprendre la raison. Je me suis bien pris la tête pour monter mon petit truc et comme c'est un peu limite black hat, j'ai pas trop envie de me planter sur une petite erreur de configuration DEBIAN quelque part sur le serveur :
======================================================================
# You may add here your
server {
        server_name MON_DOMAINE.TLD;
        return 301 http://www.MON_DOMAINE.TLD$request_uri;
}
# statements for each of your virtual hosts to this file

##
# You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean # file but keep this around for reference. Or just disable in sites- enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

server {
        #listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;

        root /home/pulco/site;
        #index index.php index.html index.htm;
        index index.html;
        access_log  /var/log/nginx/pulco.access.log combined;
        error_log  /var/log/nginx/pulco.error.log;
        # Make site accessible from http://localhost/
        server_name www.MON_DOMAINE.TLD;
        # return 301 http://www.MON_DOMAINE.TLD$request_uri;
        # rewrite ^(.*)$ http://www.MON_DOMAINE.TLD/$1 permanent;
        # rewrite ^(.*)$ http://www.vitecv.com$1 permanent;

        error_page 404 /404.html;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                # try_files $uri $uri/ /index.php;
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
                # deny  178.77.64.0/18;         # D (hosteurope.de)
                # deny  77.73.2.192;            # UK (Memset Ltd)
                # deny all;
                allow all;

if ($http_user_agent ~* bot|crawl|google|bing|spider| tools|java) {
                        return 403;
                }

                add_header X-Robots-Tag "noindex, noarchive";
        }

        location ~ /wp-config\.php { deny all; }
        location ~* /(?:uploads|files)/.*\.php$ { deny all; }
        location ~ /\.ht { deny all; }
        location ~* wp-login\.php {
                allow 127.0.0.1;
                deny all;
        }

        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                allow ::1;
                deny all;
        }

location ~* \.(xml)$ {
add_header X-Robots-Tag "noindex, noarchive";
}

location ~* \.(jpg|jpeg|gif|css|png|js|ico|zip|txt|swf|mp3)$ {
expires         15d;
add_header      Cache-Control public;
add_header X-Robots-Tag "noindex, noarchive";
}
======================================================================


Reply to: