Skip to content

Instantly share code, notes, and snippets.

@rod-dot-codes
Created June 8, 2013 18:30
Show Gist options
  • Save rod-dot-codes/5736140 to your computer and use it in GitHub Desktop.
Save rod-dot-codes/5736140 to your computer and use it in GitHub Desktop.
A basic Nginx Static File server, particular focused for use with Backbone.js install.
server {
listen {{ports}};
{% if ssl_secure %}
include ssl_secure;
{% endif %}
server_name {{url}};
client_max_body_size 5G;
access_log /var/log/nginx/{{url}}{{ports}}.access;
error_log /var/log/nginx/{{url}}{{ports}}.errors;
{% for static in static_locations %}
location {{static.location}} {
alias {{static.file_system_location}};
}
{% endfor %}
{% if redirect_html_to_index %}
location ~* \.html$ {
rewrite ^(.+)\.html$ /index.html;
}
{% endif %}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment