Code Monkey home page Code Monkey logo

Comments (2)

hide2me avatar hide2me commented on July 18, 2024

try_files can't use with 'upload_pass' location. I have used following code, it works.

Application url - /image/upload, then your request url will be "/ngx_upload/image/upload" to nginx. nginx will read file and store and rewirte to application url.

location /ngx_upload {
   upload_pass @process_redirects;
    upload_pass_args on;
    upload_pass_form_field ".*";
    upload_store /tmp/;
    upload_set_form_field $upload_field_name.name "$upload_file_name";
    upload_set_form_field $upload_field_name.content_type "$upload_content_type";
    upload_set_form_field $upload_field_name.path "$upload_tmp_path";
    upload_cleanup 400 404 499 500-505;
    }
  location @process_redirects {
     rewirte ^/ngx_upload/(.*) /$1;
       }
   try_files /$host$uri @backend_app;

from nginx-upload-module.

pgaertig avatar pgaertig commented on July 18, 2024

405 Not Allowed means you pass wrong method to Nginx or to backend. Why you don't do upload_pass @backend_app;? try_files doesn't make sense here as plain file won't process an upload. Anyway not related with upload module.

from nginx-upload-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.