Ubuntu 18.04 server under .net core 2.2 launched a website. Files are uploaded to the site normally, but 404 error occurs when downloading.

Nginx configuration:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;

    location / {
        proxy_pass         http://localhost:5000;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Proto $scheme;
        #try_files $uri $uri/ =404;

The file is generated and sent in the following code:

public FileResult Download(int id)
    byte[] fileBytes = null;
    string fileName = "";
    //getting file data and name
    return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);

Tell me, please, what's the problem

0 Answers