Good day. Trying to configure nginx upload module

An example of a link that should be processed by the module:

http://server.com/?r=upload/api&uuid=0la4fzVZUMUulOliVcleXY0Kn9nmJGAy&sid=6eo5bhrslh3lggb8kmu8lgk781 

Nginx config:

  server { listen *:80; server_name server.com; error_log /var/log/nginx/error.log error; access_log /var/log/nginx/access.log; # Define root root /path/to/root; set $fs_webroot "/path/to/root"; index index.php; # robots.txt location = /robots.txt { alias $fs_webroot/deny.robots.txt; } # Upload form should be submitted to this location location ~ "^/\?r=upload/api(.*)" { client_max_body_size 500M; # Pass altered request body to this location upload_pass @php_fpm; # Resumable upload upload_resumable on; upload_state_store /upload_path/states; # Store files to this directory upload_store /upload_path; # Set specified fields in request body upload_set_form_field "${upload_field_name}_name" $upload_file_name; upload_set_form_field "${upload_field_name}_path" $upload_tmp_path; upload_pass_args on; # Cleanup upload_cleanup 400 401 403 404 499 500-505; add_header 'Access-Control-Allow-Origin' '*'; } # Domain root location / { try_files $uri $uri/ /index.php?$query_string; } location ~\.php$ { fastcgi_pass unix:/path_to_sock.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name; include fastcgi_params; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param PATH_INFO $fastcgi_script_name; add_header Pragma no-cache; add_header Cache-Control no-cache,must-revalidate; add_header Access-Control-Allow-Origin *; } location @php_fpm { fastcgi_pass unix:/path_to_sock.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name; include fastcgi_params; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param PATH_INFO $fastcgi_script_name; add_header Pragma no-cache; add_header Cache-Control no-cache,must-revalidate; add_header Access-Control-Allow-Origin *; } 

In the POST requests log I get "200". But I clearly see that the request is NOT processed by the module. I suspect that the problem is in curve regulars.

Help! :) Thank you in advance.

  • To work with get parameters, it seems, there is a variable $args , the parameters in the location do not register. - Visman
  • POST here, not GET - Nick Katsy
  • That's why inventing difficulties for yourself to try and then heroically overcome? Why it is impossible to make an address like http://server.com/upload/?uuid=xxx ? - Alexey Ten
  • $request_body, эта переменная содержит тело запроса. Значение переменной появляется в location'ах, обрабатываемых директивами proxy_pass и fastcgi_pass. - Visman
  • one
    @NickKatsy everything in urla after the question mark is GET-parameters. And it is absolutely unimportant that you have a POST request. - Alexey Ten

0