Hello, well I have tried that, but I have made very simple settings which is like this and it looks too me that response is never served to client. When I use wget - it tries to get response several times, but is not served. Firefox does same stuff then complains that request was not finished. Chrome says that it got ERR_EMPTY_RESPONSE without headers and other stuff.
[uwsgi] strict = true http-timeout = 120 socket-timeout = 120 http = 0.0.0.0:8070 master = true threads = 4 offload-threads = 2 processes = 3 stats = 127.0.0.1:9191 memory-report = true buffer-size = 50000 single-interpreter = true route = ^/static/(.*) static:$(PWD)/static/$1 route-run = break:404 Not Found 2017-03-30 22:28 GMT+02:00 Roberto De Ioris <[email protected]>: > > > Hello, > > > > we are using uWSGI for some time on pripravto.cz project for > > joiners/furniture makers. It works quite nice, we mostly like options and > > stats, and error logging. Currently we wanted to improve serving of > static > > files (we are currently serving them through app) have tried to use serve > > static files. We have tried option static-map= which works quite nice, > but > > we need to control access to files a little so we have tried route > option. > > When file is present it works quite nice. But when file is not present, > it > > gets called several times (we are not sure why). It seems that it is not > > possible to server error 404? It just recursively calls several times and > > under HTTPS it actually does not server response to client. Just this one > > line makes it to behave this way. If we remove it > serving is done by > our > > app and it is okay. > > > > route = ^/static/(.*) static:$(PWD)/static/$1 > > > > > > We were using with uwsgi 2.0.14, python2.7.12, build with pcre, we have > > single interpreter option, threads, processes, master process a > > offloading. > > All this is under ubuntu12.04 Is there a way how this can be stopped, or > > are we doing something wrong? Bellow there is log for accessing file > which > > is in directory and then again which is not there. We have actually > wanted > > to use route-labels and other routing stuff, but it turns out, that it > > behaves in same way. > > > > Anyway, thanks for great project, which is fairly easy to use and just > > works. > > > > > > > > ####FIRST requests served via 304 and offload when file is present > > {address space usage: 468115456 bytes/446MB} {rss usage: 24731648 > > bytes/23MB} [pid: 17381|app: -1|req: -1/6] 127.0.0.1 () {44 vars in 878 > > bytes} [Sat Mar 25 13:55:57 2017] GET /static/js/utils.js => generated > > 71231 bytes in 0 msecs via offload() (HTTP/1.1 200) 2 headers in 88 bytes > > (0 switches on core 0) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24612864 > > bytes/23MB} [pid: 17378|app: -1|req: -1/7] 127.0.0.1 () {44 vars in 911 > > bytes} [Sat Mar 25 13:56:07 2017] GET /static/js/utils.js => generated 0 > > bytes in 0 msecs (HTTP/1.1 304) 0 headers in 29 bytes (0 switches on core > > 3) > > > > > > ####File is not in directory > here it just gets called several times > > {address space usage: 468115456 bytes/446MB} {rss usage: 24776704 > > bytes/23MB} [pid: 17381|app: -1|req: -1/8] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 1) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24641536 > > bytes/23MB} [pid: 17378|app: -1|req: -1/9] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 2) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24526848 > > bytes/23MB} [pid: 17382|app: -1|req: -1/10] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24563712 > > bytes/23MB} [pid: 17382|app: -1|req: -1/11] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24666112 > > bytes/23MB} [pid: 17378|app: -1|req: -1/12] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 1) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24690688 > > bytes/23MB} [pid: 17378|app: -1|req: -1/13] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 1) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24694784 > > bytes/23MB} [pid: 17378|app: -1|req: -1/14] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 3) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24694784 > > bytes/23MB} [pid: 17378|app: -1|req: -1/15] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24739840 > > bytes/23MB} [pid: 17378|app: -1|req: -1/16] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 2) > > {address space usage: 468115456 bytes/446MB} {rss usage: 24743936 > > bytes/23MB} [pid: 17378|app: -1|req: -1/17] 127.0.0.1 () {40 vars in 813 > > bytes} [Sat Mar 25 13:56:54 2017] GET /static/js/us => generated 0 bytes > > in > > 0 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 1) > > > > -- > > Regards, > > > > Zdenek & Michal > > > > > > > Hi, the retrying og the static files is pretty strange, it looks like the > client is triggering the retry when it gets 500. > > By the way, there is a plugin called notfound in the project that you can > use as a fallback, but i think in your specific case the > > break:404 Not Found > > routing action would be more suited: > > route = ^/static/(.*) static:$(PWD)/static/$1 > ; if the previous rule fails, returns 404 > route-run = break:404 Not Found > > > -- > Roberto De Ioris > http://unbit.com > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi > -- -- S pozdravem, Zdeněk Dlauhý Email:[email protected] Mobil: +420 702 549 370 Web: www.pripravto.cz
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
