nginx Serving Static Content with POST Method (error 405)

  • Posted on: 2 July 2014
  • By: oon

I got error 405 while try to access static content (HTML, XML, JS, images) with HTTP Post Method.

this is how to solve the problem using proxy


upstream static_backend {
server localhost:8889;
}
server {
listen 80;
server_name xx.oo.or.id;

location @405 {
root /home/xx/sites/;
proxy_method GET;
proxy_pass http://static_backend;
}
}
server {
listen 8889;
server_name _;
root /home/xx/sites/;
}

or you can try the patch from Igor's (the author of nginx) [2]

[1]http://invalidlogic.com/2011/04/12/serving-static-content-via-post-from-...
[2]http://forum.nginx.org/read.php?2,2414,2420#msg-2420

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.