Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Created January 29, 2017 08:52
Show Gist options
  • Save lbvf50mobile/abbafd1330d5b45234184400d189eea0 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/abbafd1330d5b45234184400d189eea0 to your computer and use it in GitHub Desktop.
##
# Thursday 2016.07.15 21:22 http://vjuh-developer.livejournal.com/5319.html
# Monday 2017.01.23 19:14
# Start to create the configuration for my PUMA
# http://stackoverflow.com/questions/17450672/how-to-start-puma-with-unix-socket
##
upstream sitenumber1_app {
server unix:///tmp/sitenumber1.socket;
}
server {
# set client body size to 2M #
client_max_body_size 2M;
listen *:80;
server_name sitenumber1.com;
access_log /var/log/nginx/my_app-access.log;
#location /favicon.ico {
# root /var/www/my_app/public/assets/favicon.ico;
# gzip_static on;
#expires max;
#add_header Cache-Control public;
# }
location / {
root /home/dima/del/sitenumber1/public;
#root /home/ubuntu/smc2016/public;
try_files $uri @app;
gzip_static on;
expires max;
add_header Cache-Control public;
}
location @app {
proxy_pass http://sitenumber1_app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_next_upstream error timeout invalid_header http_502;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment