Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
Openshift Apache/Nginx 405 not allowed

We are using OpenShift 3.4. Using a s2i PHP image for pod. When doing a curl from pod to an external resource it's returning 405 Not Allowed nginx/1.16.1. The code is running fine on the local setup. As I understood from web, it's due to the fact our own server is not allowing POST request and we need to configure it to allow the same.

$ch = curl_init($ldapAuthURL);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$response = curl_exec($ch);

I am unable to resolve this, since I don't have any experience with OpenShift I tried looking for httpd file but it's to be found no where. The support team is not able to help either, they are saying they support image pushing and pulling only and it's our application code that is faulty.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

To my dismay support team was right, It was an application issue. My team member has configured the URL of the frontend which was running an angular app on nginx. Hence the cryptic error 405 nginx since the frontend won't support post requests on that URL.

That's why there were no Nginx config files in the PHP pod since it was using Apache to serve the files.

Steps to resolve:

  1. I created a standalone curl service in PHP using the public URL.
  2. It worked. Then I was sure there's some issue with my application code
  3. I tried standalone curl with the URL PHP was hitting, it returned the same 405 error.
  4. It gave a clear result there's some issue with the URL
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda