Skip to content

Instantly share code, notes, and snippets.

@maxd
Last active December 10, 2016 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxd/5231139 to your computer and use it in GitHub Desktop.
Save maxd/5231139 to your computer and use it in GitHub Desktop.
sites-available/application.site
proxy_cache_path /tmp/???_nginx_cache keys_zone=???:512m inactive=2w;
server {
listen 8081;
error_log /var/log/nginx/???.error.log error;
access_log /var/log/nginx/???.access.log;
root /apps/???/current/public;
passenger_enabled on;
rails_env production;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types application/json text/css application/javascript text/javascript application/x-javascript;
location ~* \.(js|css|png|ico) {
expires 30d;
}
}
server {
listen 80;
# server_name ???-api.example.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location /media {
proxy_cache ???;
proxy_pass http://127.0.0.1:8081;
}
location / {
proxy_pass http://127.0.0.1:8081;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment