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

149
Visualizações
NGINX 404 not found but file exists

I want to call the index.html from the folder /var/www/fileUpload/html. The index.html file exists in that folder.

The / router works. the uploadFiles route as well. But when I open the upload route I get a 404 error.

    server{
    listen 80;
    server_name xx.xx.xxx.xxx;

    location / {
        root /var/www/kioskJPE/html;
        index index.html;
    }
    location /upload {
        root /var/www/fileUpload/html;
        index index.html;
    }
    location /uploadFiles {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Do you have any suggestions? Thank you!

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

0

That should be alias /var/www/fileUpload/html; otherwise Nginx is looking for the file in /var/www/fileUpload/html/upload/index.html. See this document for details.

For example:

location /upload {
    alias /var/www/fileUpload/html;
}
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