• [^] # Re: Salut

    Posté par . En réponse au message [Nginx load balancing] erreur 404. Évalué à 2.

    Salut,
    Dans les deux cas j'ai une 404, que je fasse du HTTPS vers HTTP ou du HTTP de bout en bout.
    J'ai ajouté les proxy headers car lorsque j'attaque mes backends j'ai une réponse HTTP redirect vers HTTPS.
    En gros s'il ne recoit pas dans l'en tête X-FORWARDED-FOR que l'url d'origne était en HTTPS à ce moment la il fait un http redirect vers la même url en https.

    Voici le log nginx ful

    2018年02月17日 12:46:28 [debug] 15406#15406: 219 SSL_do_handshake: -1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_get_error: 2
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 reusable connection: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL handshake handler: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_do_handshake: 1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL: TLSv1.2, cipher: "ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 reusable connection: 1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http wait request handler
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 malloc: 000055F8B85EC460:1024
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_read: -1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_get_error: 2
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 free: 000055F8B85EC460
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http wait request handler
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 malloc: 000055F8B85EC460:1024
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_read: 399
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_read: -1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 SSL_get_error: 2
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 reusable connection: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 posix_memalign: 000055F8B85149E0:4096 @16
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http process request line
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http request line: "GET / HTTP/1.1"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http uri: "/"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http args: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http exten: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http process request header line
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Host: www.mywebapp.fr"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 posix_memalign: 000055F8B85E8550:4096 @16
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,
    /;q=0.8"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Accept-Encoding: gzip, deflate, br"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Connection: keep-alive"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Upgrade-Insecure-Requests: 1"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Pragma: no-cache"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header: "Cache-Control: no-cache"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http header done
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 event timer del: 3: 1518868048380
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 generic phase: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 rewrite phase: 1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 test location: "/"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 using configuration "/"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http cl:-1 max:1048576
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 rewrite phase: 3
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 post rewrite phase: 4
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 generic phase: 5
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 generic phase: 6
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 generic phase: 7
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 access phase: 8
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 access phase: 9
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 access phase: 10
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 post access phase: 11
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http init upstream, client timer: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 epoll add event: fd:3 op:3 ev:80002005
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "X-Forwarded-For: "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script var: "192.168.184.254"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "X-Forwarded-Host: "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script var: "www.mywebapp.fr"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: ":443"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "X-Forwarded-Server: "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script var: "www.mywebapp.fr"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "X-Forwarded-Port: 443
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "X-Forwarded-Proto: https
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "Host: "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script var: "mywebappw"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: "Connection: close
    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http script copy: ""
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,
    /;q=0.8"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Accept-Encoding: gzip, deflate, br"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Upgrade-Insecure-Requests: 1"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Pragma: no-cache"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Cache-Control: no-cache"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header:
    "GET / HTTP/1.1
    X-Forwarded-For: 192.168.184.254
    X-Forwarded-Host: www.mywebapp.fr:443
    X-Forwarded-Server: www.mywebapp.fr
    X-Forwarded-Port: 443
    X-Forwarded-Proto: https
    Host: mywebappw
    Connection: close
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,
    /*;q=0.8
    Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
    Accept-Encoding: gzip, deflate, br
    Upgrade-Insecure-Requests: 1
    Pragma: no-cache
    Cache-Control: no-cache

    "
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http cleanup add: 000055F8B85E8F48
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 init keepalive peer
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 get keepalive peer
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 get ip hash peer, try: 6
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 get ip hash peer, hash: 1 0002
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 stream socket 14
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 epoll add connection: fd:14 ev:80002005
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 connect to 10.236.10.22:80, fd:14 #220
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream connect: -2
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 posix_memalign: 000055F8B85E6E40:128 @16
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 event timer add: 14: 60000:1518868048564
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http finalize request: -4, "/?" a:1, c:2
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http request count:2 blk:0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http run request: "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream check client, write event:1, "/"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream request: "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream send request handler
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream send request
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream send request body
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 chain writer buf fl:1 s:551
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 chain writer in: 000055F8B85E8FE8
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 writev: 551 of 551
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 chain writer out: 0000000000000000
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 event timer del: 14: 1518868048564
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 event timer add: 14: 3600000:1518871588564
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream request: "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream process header
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 malloc: 000055F8B85E9560:4096
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 recv: eof:0, avail:1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 recv: fd:14 492 of 4096
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy status 404 "404 Not Found"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Content-Type: text/html; charset=us-ascii"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Server: Microsoft-HTTPAPI/2.0"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Date: 2018年2月17日 11:51:15 GMT"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Connection: close"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header: "Content-Length: 315"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy header done
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 HTTP/1.1 404 Not Found
    Server: nginx/1.13.1
    Date: 2018年2月17日 11:46:28 GMT
    Content-Type: text/html; charset=us-ascii
    Content-Length: 315
    Connection: keep-alive

    2018年02月17日 12:46:28 [debug] 15406#15406: *219 write new buf t:1 f:0 000055F8B85E92A0, pos 000055F8B85E92A0, size: 173 file: 0, size: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http write filter: l:0 f:0 s:173
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http cacheable: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http proxy filter init s:404 h:0 c:0 l:315
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http upstream process upstream
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe read upstream: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe preread: 315
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe buf free s:0 t:1 f:0 000055F8B85E9560, pos 000055F8B85E9611, size: 315 file: 0, size: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe length: 315
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 input buf #0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe write downstream: 1
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe write downstream flush in
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http output filter "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http copy filter: "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 posix_memalign: 000055F8B85EA570:4096 @16
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http postpone filter "/?" 000055F8B85E9488
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 write old buf t:1 f:0 000055F8B85E92A0, pos 000055F8B85E92A0, size: 173 file: 0, size: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 write new buf t:1 f:0 000055F8B85E9560, pos 000055F8B85E9611, size: 315 file: 0, size: 0
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http write filter: l:0 f:0 s:488
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 http copy filter: 0 "/?"
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 pipe write downstream done
    2018年02月17日 12:46:28 [debug] 15406#15406: *219 event timer: 14, old: 1518871588564, new: 1518871588565