Skip to content

Instantly share code, notes, and snippets.

@stonegao
Forked from lardissone/gist:2152225
Created April 12, 2012 10:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stonegao/2366309 to your computer and use it in GitHub Desktop.
Save stonegao/2366309 to your computer and use it in GitHub Desktop.
Nginx config file to serve static file over POST
server {
listen 80;
client_max_body_size 4G;
access_log /var/sites/webapp/logs/access.maintenance.log;
error_log /var/sites/webapp/logs/error.maintenance.log info;
server_name api.webapp.com;
# this guy redirects any path to /api.json
rewrite ^.*$ /api.json last;
location / {
root /var/sites/webapp/webapp/;
index api.json /api.json;
# this is the magic
error_page 405 = $uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment