* Roberto De Ioris <[email protected]> [2014-01-22 09:02]: >> Hi, >> >> I'm revisiting static file serving from outside the docroot via >> routing. Based on my initial thread at >> http://lists.unbit.it/pipermail/uwsgi/2013-July/006214.html I've >> come up with the following minimal configuration: >> >> [uwsgi] >> plugins = >> 0:notfound,http,cgi,router_redirect,router_rewrite,router_static,router_uwsgi >> http-socket = 127.0.0.1:8080 >> >> route-if-not = regexp:${PATH_INFO};^/webapp(/.*)? goto:skip-webapp >> route-run = setdocroot:/tmp/webapp >> route-if = regexp:${PATH_INFO};^/webapp(/.*)?$ setpathinfo:$1 >> ;route-if = regexp:${PATH_INFO};\.(php|php5|cgi|lua|pl|py|rb|sh|tcl)$ >> goto:skip-webapp >> route-if = isfile:/tmp/webapp/${PATH_INFO} >> file:filename=/tmp/webapp/${PATH_INFO};mime=1 >> route-label = skip-webapp >> ;for = .cgi .lua .pl .py .rb .sh .tcl >> ; route = \%(_)$ uwsgi:,9,0 >> ;endfor = >> >> However I cannot get it to work, uwsgi only closes the connection >> when requesting an existing file: >> >> $ ls /tmp/webapp/ >> index.cgi index.html >> $ curl -v http://127.0.0.1:8080/webapp/index.html >> * About to connect() to 127.0.0.1 port 8080 (#0) >> * Trying 127.0.0.1... >> * Adding handle: conn: 0x7e14c0 >> * Adding handle: send: 0 >> * Adding handle: recv: 0 >> * Curl_addHandleToPipeline: length: 1 >> * - Conn 0 (0x7e14c0) send_pipe: 1, recv_pipe: 0 >> * Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0) >>> GET /webapp/index.html HTTP/1.1 >>> User-Agent: curl/7.32.0 >>> Host: 127.0.0.1:8080 >>> Accept: */* >>> >> * Empty reply from server >> * Connection #0 to host 127.0.0.1 left intact >> curl: (52) Empty reply from server >> >> Any idea what's wrong here? > > Does the uWSGI log report something ?
No, nothing useful: add uwsgi var: REQUEST_METHOD = GET add uwsgi var: REQUEST_URI = /webapp/index.html add uwsgi var: PATH_INFO = /webapp/index.html add uwsgi var: QUERY_STRING = add uwsgi var: SERVER_PROTOCOL = HTTP/1.1 add uwsgi var: SCRIPT_NAME = add uwsgi var: SERVER_NAME = hal.lan add uwsgi var: SERVER_PORT = 8080 add uwsgi var: REMOTE_ADDR = 127.0.0.1 [uWSGI DEBUG] PATH_INFO=/webapp/index.html [uWSGI DEBUG] SCRIPT_NAME= [uWSGI DEBUG] SERVER_NAME=hal.lan [uWSGI DEBUG] HTTP_HOST=127.0.0.1:8080 -- Guido Berhoerster _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
