Static files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Static files

vergil
I'm trying to figure out how to load static files .

I added to /etc/nginx/conf.d/default.conf the following lines:

server {
    location / {
      root
/home/marco/webMatters/vueMatters/ggc/src/components/auth/weights;
    }
}

But I'm still getting this error: Uncaught (in promise) SyntaxError:
Unexpected token < in JSON at position 0
which, according to the people intervened in the github issue, should be
related to a mis-configuration in the web-server for static files serving:
https://github.com/justadudewhohacks/face-api.js/issues/598#issuecomment-626346393

How to solve the problem?
Looking forward to your kind help.
Marco

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,287991,287991#msg-287991

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Static files

vergil
Following the indications here:
https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/
I modified the lines in /etc/nginx/conf.d/default.conf as follows:

server {
    root
/home/marco/webMatters/vueMatters/GraspGlobalChances/src/components/auth/weights;

    location / {
      try_files $uri /weights/ssd_mobilenetv1_model-shard1;
    }
}

I also tried to add these two options:

server {
    root
/home/marco/webMatters/vueMatters/GraspGlobalChances/src/components/auth/weights;

    location / {
      sendfile on;
      tcp_nopush on;
      try_files $uri /weights/ssd_mobilenetv1_model-shard1;
    }
}

But still got the problem

Marco

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,287991,287992#msg-287992

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

RE: Static files

Reinis Rozitis
In reply to this post by vergil
> server {
>   location / {
>       root
> /home/marco/webMatters/vueMatters/ggc/src/components/auth/weights;
>    }
> }

Since it's under /home most likely nginx has no access to the directory.

Check the user under which nginx is running (probably nobody) and try to check if you can read the files
(su nobody -c ls /home/marco/webMatters/vueMatters/ggc/src/components/auth/weights)


rr

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Static files

Francis Daly
In reply to this post by vergil
On Mon, May 11, 2020 at 10:24:49AM -0400, MarcoI wrote:

Hi there,

> I'm trying to figure out how to load static files .

What request do you make?

What file on your filesystem do you want nginx to return, in response
to that request?

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx