Nginx Upload Progress Module stops functioning once behind reverse-proxy
Ben Johnson
ben at indietorrent.org
Mon Feb 16 19:55:51 UTC 2015
Hello,
I've recently compiled nginx-1.7.10 with a third-party upload-progress
tracking module, which is described at
http://wiki.nginx.org/HttpUploadProgressModule .
This module works perfectly well, until I attempt to put the entire
setup behind a reverse-proxy.
Below is a simplified configuration that demonstrates the issue I'm having.
With this configuration, the upload progress reporting functions
correctly *only* if I access the reverse-proxy port directly, at
https://example.com:1337.
As soon as I attempt to access the upstream host at https://example.com
(on port 443, instead of the proxy port, 1337), the upload progress
module always reports "starting" as its state (which, according to the
documentation, implies "the upload request hasn't been registered yet or
is unknown").
Once I have this working with the reverse-proxy in-place, I want to
change the line "listen *:1337 ssl;" to "listen 127.0.0.1:1337 ssl;" so
that user-agents cannot access the proxy directly.
Might anyone know why this module ceases to work correctly once behind a
reverse-proxy, as the below config demonstrates?
Is there some proxy-specific configuration directive that I've overlooked?
Thanks for any help!
-Ben
###################################################################
http {
server {
listen *:443 ssl;
location ^~ / {
proxy_pass https://127.0.0.1:1337;
}
}
upload_progress uploads 5m;
server {
listen *:1337 ssl;
location @virtual {
include fastcgi_params;
fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
location = /progress/ {
report_uploads uploads;
upload_progress_json_output;
}
location /file-upload/progress/ {
proxy_pass https://127.0.0.1:1337;
track_uploads uploads 5s;
}
}
}
###################################################################
More information about the nginx
mailing list