Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!