I’m trying to use post_action to track some download information, but
I’m
having a few issues. I’ve done some searching, but the documentation for
this feature is almost non-existant from what I can see. Am I missing
something?
Anyway, my two main questions.
- I have a server config that proxies all requests and all directories
for
a number domains directly to a backend server. Because it’s all
directories,
I can’t reserve one for the post_action handler like the examples I’ve
normally seen. (e.g. the example here:
http://article.gmane.org/gmane.comp.web.nginx.english/1070/)
So I’ve tried this:
server {
listen a.b.c.d:80;
location / {
rewrite (.*) /http/$host$1 break;
proxy_pass http://backend/;
...
}
post_action http://127.0.0.1/done;
}
server {
listen 127.0.0.1:80;
location = /done {
fastcgi_pass … etc …
}
}
But that didn’t seem to work. Is there any way to get the post_action to
submit to a completely separate server { } block?
-
I want to pass a header returned by the upstream server to the
post_action handler for logging purposes, but I’m not sure how to do
that. I
must be missing something obvious here.
fastcgi_param PARAM_EXTRA_1 …some upstream header…;
Thanks
Rob
To reply to myself…
-
I want to pass a header returned by the upstream server to the
post_action handler for logging purposes, but I’m not sure how to do that.
I must be missing something obvious here.
fastcgi_param PARAM_EXTRA_1 …some upstream header…;
I found this previous post:
http://article.gmane.org/gmane.comp.web.nginx.english/1305
Which seems to fix issue 2 nicely. Now if only I could fix the first
issue.
Rob
On Mon, Feb 25, 2008 at 03:26:18PM +1100, Rob M. wrote:
http://article.gmane.org/gmane.comp.web.nginx.english/1305
Which seems to fix issue 2 nicely. Now if only I could fix the first issue.
The attached patch enables named location in post_action:
post_action @done;
location @done {
...
On Tue, Feb 26, 2008 at 08:53:17AM +1100, Rob M. wrote:
… } block right?
Yes. There is no way to redirect a request internally to another server.
The attached patch enables named location in post_action:
post_action @done;
location @done {
…
Great, I’ll try that out.
Just to check, the “named location” still has to be in the same server {
… } block right?
Rob
Sorry if this has already been discussed, but what options are available
to allow clients to be able to upload files in nginx?
I’m aware of the webdav module which would obviously work, but what
other options are there?
Also, what kind of limitations would one run into? Would uploading
large files pose a problem, if so, how large is too large?
Thanks, and sorry again if this topic has already been covered.
Doug