我正在尝试configuration我的nginx,以便我能够将一些file upload到我的服务器上的一个目录。 这是我从某处find的基本configuration:
location /upload-modified-reports/ { limit_except POST { deny all; } client_body_temp_path /tmp/nginx; client_body_in_file_only on; client_body_buffer_size 128K; client_max_body_size 50M; proxy_pass_request_headers on; #proxy_set_header content-type "text/html"; proxy_set_header X-FILE $request_body_file; proxy_set_body $request_body_file; #proxy_pass http://localhost:8080; proxy_redirect off; }
经过这个我明白了上面的configuration是做什么的,但是当我使用ajax发送一个请求在/upload-modified-reports我得到的method not allowed 。 我想这是因为在上面的configurationproxy_pass部分。 这是一个提供一个proxy_pass的标准方法,将请求转发给我们,或者我们可以完全省略这部分?
我所需要的是,我必须能够将file upload到临时位置,并且,如果可能的话,文件的名称可用于位于nginx后面的应用程序服务器。