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

133
Visualizações
Ajax GET for error_log contents works locally but returns 403 on server

I have that tiny script :

<script>
$( document ).ready(function() {
    $('button').on('click', function(event, state) {
            var path = $(this).data("path");
            console.log(path);
            $.ajax({
              type:"GET",
              url: path,
              dataType: 'text',
              contentType: 'text',
              async: true,
              success: function (data) {
                  $("#file-content").text(data);
              }
          });
        });     
});
</script>

and HTML part is :

<button type="button" class="btn btn-primary" data-path="/error_log">error_log</button>
<button type="button" class="btn btn-primary" data-path="/log.txt">log.txt</button>
<div id="file-content" style="white-space: pre-line;"></div>

That code works perfectly on my Macbook, running apache locally. But once uploaded on my server, the loading of /log.txt works perfectly BUT loading error_log file returns 403 error. I checked permissions on those files and they are exactly the same permissions :

-rw-r--r--.  1 XXXXXXXXX XXXXXXXXX  1000 14 aoû 23:00 error_log
-rw-r--r--.  1 XXXXXXXXX XXXXXXXXX  6032 16 aoû 09:55 log.txt

I can't figure out the problem. Could you help me please ??

Best regards,

T.

over 4 years ago · Santiago Trujillo
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