Hello,
Please help me set upload progress, since I wasn't able to make it work simple following module instructions. I have latest module version (7.x-2.3) . I see "Upload progress nginx Enabled (upload progress module )" in Status report.
My nginx configuration is:
root@server:~# nginx -V
nginx version: nginx/1.2.5
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --add-module=/usr/src/nginx-upload-progress-module-master
I have upload_progress uploads 1m;
string in /etc/nginx/nginx.conf
I have this in my virtual host configuration file:
server {
listen *:80;
index index.php index.html;
server_name site.com;
location ^~ /progress {
access_log off;
upload_progress_json_output;
report_uploads uploads;
}
location ~ (.*)/x-progress-id:(\w*) {
rewrite ^(.*)/x-progress-id:(\w*) $1?X-Progress-ID=$2;
}
Now after "root@server:~# service nginx restart" I got:
unknown directive " " in /etc/nginx/sites-enabled/site.com:11
Also, I got
An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (200 MB) that this server supports.
testing 4Mb file upload.
I saw similar issues in issue queue (all closed and resolved(?)) so feel I'm doing something wrong, but not sure what exactly.
So please could someone point me in the right direction.
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#10 | unknown_directive_nginx_V_diff.png | 91.49 KB | yurg |
#10 | unknown_directive_nginx_LDD_diff.png | 47.16 KB | yurg |
Comments
Comment #1
perusio CreditAttribution: perusio commentedYou have first a config problem. Also after changing the nginx config there's no need for a restart but rather a reload.
You have a config that is not the correct one for D7. The regex double capture is an overkill.
Comment #2
perusio CreditAttribution: perusio commentedComment #3
yurg CreditAttribution: yurg commentedThank you perusio for your help. Indeed, these rules was taken somewhere from internet just after I tried to use "default: module instructions. I just tried to use D7 code from Nginx configuration #2 ("Do a rewrite to support the way that the Nginx module reports the progress.") and got the same
where line 12 is:
I did change nginx version to 1.2.1, just in case, so now I have this:
and
upload_progress uploads 1m;
in http block of nginx.conf .I doubt if
<upload_form_uri>
should be real uri of page where upload form is located. Also, "Use the 3rd party Upload Progress Nginx module." link on module main page is dead (https://github.com/masterzen/nginx-upload%20progress-module points to non-existent page.). I was able to use build instructions link ( http://wiki.nginx.org/HttpUploadProgressModule#Installation ) but still no luck.Looks like I missed something really obvious. Please point me in the right direction. Thank you!
Comment #4
perusio CreditAttribution: perusio commentedI'm wondering if this comes from a bad PCRE library version that makes the regexes go mad. Just to be sure. Comment out all
Upload Progress module stuff and do the following:
Create a
test
directory and dotouch a.txt
. Nowcurl -I site.com/test/a.txt
must check the empty text file.Comment #5
yurg CreditAttribution: yurg commentedThank you for your help. Now test code gives me exactly same message
where line 33 is here:
Something with my nginx I guess? But I have other rewrite rules which works (or at least which are silent afater nginx reload):
Comment #6
perusio CreditAttribution: perusio commentedOk. It seems there's a problem with your PCRE library. What does
ldd /usr/sbin/nginx
give for you?Here's mine:
Can you get a debug log output? http://nginx.org/en/docs/debugging_log.html
Comment #7
yurg CreditAttribution: yurg commentedHere's it ( your's is 64bit ):
Going to configure with debugging log.
Comment #8
yurg CreditAttribution: yurg commentedNothing unusual in server logs after debug.
But may be this:
auth_basic directive was commented out while upload progress testing though.
Comment #9
perusio CreditAttribution: perusio commentedI don't think it's a config problem. I'm inclined to think about a problem with your nginx binary, either stemming from a bad PCRE library or a build process gone wrong somewhere.
Try other version and or package and see how it goes.
Comment #10
yurg CreditAttribution: yurg commentedI made some tests trying ti isolate this issue: same nginx 1.2.4 was configured locally and remotely using same methods and same technique. Now upload progress works locally but still doesn't work remotely, with nginx reload fail message:
Configuration comparisons between local and remote servers are attached (both nginx -V and ldd /usr/sbin/nginx ).
Looks like dead end from my side so any suggestions would be highly appreciated. Thank you!
Comment #11
yurg CreditAttribution: yurg commentedIssue was resolved with help from StackOverflow: http://stackoverflow.com/questions/14007391/unknown-directive-in-etc-ngi... Indeed, it was caused by PCRE version on server. So, simplified rewrite rule was used instead of "default":
Comment #12
perusio CreditAttribution: perusio commentedIndeed, somehow the PCRE library is broken or is too old. The inclusion of the variables is completely unnecessary. Try:
Comment #13
yurg CreditAttribution: yurg commented@perusio
Thank you for suggestion, tried your code, doesn't work unfortunately with same "unknown directive".
Looks like my case is rare indeed, so if anyone will "luckily" face it in a future, code from http://drupal.org/node/1862462#comment-6872466 provides working fix for it.
Comment #15
ispboy CreditAttribution: ispboy commentedfor PCRE prior to 7.0
change (?< to (?P<