Skip to content

Instantly share code, notes, and snippets.

@rkjha
Created November 12, 2014 10:21
Show Gist options
  • Save rkjha/784e6654d6558dbaa29c to your computer and use it in GitHub Desktop.
Save rkjha/784e6654d6558dbaa29c to your computer and use it in GitHub Desktop.
A simple nginx config for sinatra app [with passenger app server]
server {
listen 80;
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
server {
listen 80;
server_name example.com;
root /home/username/example.com/public;
passenger_enabled on;
# Cache static content
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires 30d;
add_header Vary Accept-Encoding;
access_log off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment