Web & Digital Culture

Serve static files from nginx for POST request

This is a quick tip, I haven't had the time to dig deep into this. I am working on a Facebook app, and was doing a demo with static HTML. Everything was set, in...

Sumit Datta··1 min read

This is a quick tip, I haven’t had the time to dig deep into this. I am working on a Facebook app, and was doing a demo with static HTML. Everything was set, including SSL (I will write quick tip on that too). I could browse to the page separately. But it failed from within Facebook, giving a 405 error.

From previous experience I remembered Facebook does POST requests, but I had forgotten the fix for static files. For some reason nginx does not allow serving static files for HTTP POST request. Anyway the fix was:

    error_page 405 = $uri;

Also here is another suggestion: Serving Static Content Via POST From Nginx

Hope this helps you.

Share
Written by
Sumit Datta

Software engineer and entrepreneur, 16+ years at fast-paced startups across the US, Canada, Germany and India.

Comments

Hook this up to your favourite commenting platform — Giscus, Disqus, or your own.

Continue reading

Web & Digital Culture·

Google's Les Paul Doodle

Today (June 9, 2011, India) Google's doodle on Les Paul is just a great time killer. Spent the whole morning interacting with it. I got interested to understand...

Sumit Datta · 1 min

A quieter inbox.

One thoughtful letter every other Sunday — new essays, things worth reading, and the occasional photograph.

Free. Unsubscribe in one click.