Redirection PHP et LB
... / Redirection PHP et LB
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
question

Redirection PHP et LB

Par
dgoujard
Créé le 2016-10-20 07:40:00 (edited on 2024-09-04 12:34:54) dans [Lab] Containers (deprecated)-old

Bonjour (c'est encore moi),

J'ai un container php derrière un LB Marathon, quand j'essaye de faire une redirection vers un fichier Object Storage en local ça fonctionne bien mais quand le LB est en frontal cela me donne une erreur 502 bad gateway.

Quand j'utilise directement le container avec sont port (publiquement accessible c'est pas un peu dangereux ?) cela fonctionne pourtant bien
> curl -I http://slave-0045.sbg-1.containers.ovh.net:PORTDUCONTAINER/fileassetredirect.php?path=photos/diaporama/Diaporama_HOME/diapo1.jpg
> HTTP/1.1 302 Found
> Date: Thu, 20 Oct 2016 07:25:29 GMT
> Server: Apache/2.4.10 (Debian)
> Location : https://storage.gra1.cloud.ovh.net/v1/AUTH_1b033962ad614f6a90476e3ba644acb2/test/photos/diaporama/Diaporama_HOME/diapo1.jpg?temp_url_sig=f8ec302894442aba2a5477957c42b76d9218b9b4&temp_url_expires=1476948389
> Vary: User-Agent
> Content-Type: text/html; charset=UTF-8

Quand ça passe par le load balancer j'ai une erreur :
> curl -I http://NOMDUSERVICE.docker-gd2071-1.lb.sbg-1.containers.ovh.net/fileassetredirect.php?path=photos/diaporama/Diaporama_HOME/diapo1.jpg
> HTTP/1.0 502 Bad Gateway
> Cache-Control: no-cache
> Connection: close
> Content-Type: text/html

Comment faire pour effectuer une redirection qui fonctionne ? en utilisant une redirection via un fichier .htaccess ça fonctionne bien mais en php non :
> header("Location : ".$urlTempFile, TRUE, 302);

Merci


1 réponse ( Latest reply on 2016-10-20 11:57:08 Par
dgoujard
)

Bon pour la petite explication pour que ça marche il faut faire :
> header("location:".$urlTempFile, TRUE, 302);

Les réponses sont actuellement désactivées pour cette question.

Rejoindre la discussion