Skip to main content

Posts

Showing posts from April, 2020

405 error with Nginx configuration

I am using old (outdated) jQuery image upload libraries fengyuanchen cropper.js and tuyoshivinicius jQuery-Picture-Cut. And have error with upload functionality. It not show file chosen from upload form. Console log show 405 error. It take me few days (not really focus on) but at first I guess the problem is within the JS library. Ton of jQuery plugin and JS script. Many outdated since 2015, like jQuery-Picture-Cut have removed. Fengyuanchen cropper seem still work and document keep maintenanced. https://github.com/fengyuanchen/cropper One of my function use this library and it still work well. So I firstly try to apply this function to my broken admin upload crop image function. Fortunately I jumped into nginx issue search and fixed it. https://stackoverflow.com/questions/44612803/405-error-with-ajax-post-nginx-configuration Nginx server doesn't allow POST request with static page (ie. *.html). There are hacks to handle the problem. In my case, it fix the 405...