Enable module on two locations

Prudhvi Krishna Surapaneni me at prudhvi.net
Wed Aug 15 23:05:22 UTC 2012

Hi List,

I have a module, that i am using to serve files from two different
application specific locations.

 location ~ /download/([a-z0-9])/f/([a-z0-9]) {
  my_module_source_file file1;
  my_module_id $1;
  my_module_file_size $2;

 location ~/download/([a-z0-9])/q/([a-z0-9]) {
  my_module_source_file file2;
  my_module_id $1;
  my_module_file_size $2;

 My loc_conf_t is as follows

 typedef struct {
 	ngx_http_complex_value_t *my_id;
	ngx_str_t source_file;
	ngx_http_complex_value_t *my_size;

 I run into problems when accessing files from the second location. The
 module always trys to get file1 as the source instead of file2.

 My question is why does it always pick up the file1. But, interestingly
 the complex values are captured correctly. How can i fix this scenario
 so that it picks up the proper value for my_module_source_file basing
 on the location it was called.

 Prudhvi Surapaneni.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20120815/a84682da/attachment.bin>

More information about the nginx-devel mailing list