2016-07-15 29 views
0

Ich habe ein Setup, bei dem ein Nginx Reverse-Proxy zu einem zweiten umwandelt.Duplizierte Anmeldung bei einer einzelnen Anfrage mit einem Minuszeichen am Ende

Ich beobachtete in meinen Protokollen, dass ein Nginx sieht zwei Anfrage, aber die zweite sieht nur eine von ihnen. Ich habe auch beobachtet, dass der Browser nur eine Anfrage sendet, so dass die Duplikation, wenn sie existiert, nicht vom Client kommt. Hier

ist eine Probe der Protokolle:

nginx_1 | 192.168.64.8 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic1.jpg HTTP/1.0" 200 9402 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" 
proxy_1 | 192.168.64.1 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic1.jpg HTTP/1.1" 200 111773 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" "-" 
proxy_1 | 192.168.64.1 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic1.jpg HTTP/1.1" 200 111773 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" 
proxy_1 | 192.168.64.1 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic2.jpg HTTP/1.1" 200 25619 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" "-" 
proxy_1 | 192.168.64.1 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic2.jpg HTTP/1.1" 200 25619 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" 
nginx_1 | 192.168.64.8 - - [15/Jul/2016:11:43:32 +0000] "GET /images/mypic2.jpg HTTP/1.0" 200 25619 "http://localhost/es" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36" 

Wie Sie sehen können, ist die proxy_1 nginx als Reverse-Proxy arbeitet, und nginx_1 ist die eine Aufnahme und die Bearbeitung von Anfragen.

Am Ende jeder duplizierten Zeile können Sie ein "-" sehen, das ich nicht weiß, was es bedeutet. Ich vermute, ich mache eine Art Neuschreiben, das mir nicht bewusst ist, aber ich verstehe nicht, wie es passiert.

Können Sie mir einen Hinweis geben, was hier vor sich geht?

Hier stelle ich auch die Server-Konfiguration:

access_log /dev/stdout; 
error_log /dev/stdout; 

server { 
    listen 7000; 
    listen 80; 

    client_max_body_size 24M; 
    server_name *.rareconnect.org; 

    include /etc/nginx/params/gzip_on; 

    location/{ 
     include /etc/nginx/params/proxy_pass_local_rareconnect_org_8000; 
    } 
} 

Dies ist oben auf der Standardkonfiguration von nginx: 1.9.5 wie in der offiziellen Docker Registrierung erscheint.

user nginx; 
worker_processes 1; 

error_log /var/log/nginx/error.log warn; 
pid  /var/run/nginx.pid; 


events { 
    worker_connections 1024; 
} 


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

    log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
         '$status $body_bytes_sent "$http_referer" ' 
         '"$http_user_agent" "$http_x_forwarded_for"'; 

    access_log /var/log/nginx/access.log main; 

    sendfile  on; 
    #tcp_nopush  on; 

    keepalive_timeout 65; 

    #gzip on; 

    include /etc/nginx/conf.d/*.conf; 
} 

Vielen Dank im Voraus.

Antwort

0

Sieht so aus, als gäbe es wenige Datensätze access_log. Können Sie auch nginx.conf überprüfen?

+0

Gerade hinzugefügt es auf die Hauptnachricht –

+0

Ok, gibt es zwei 'access_log' Datensätze. Sie können 'access_log/dev/stdout;' entfernen und es erneut versuchen. Sollte gut funktionieren –