Public
Snippet $1 authored by hfpp2012

nginx puma config example

Edited
puma.conf
upstream pusheng {
    server unix:///home/hfpp2012/pusheng/shared/tmp/sockets/puma.sock fail_timeout=0;
}

server {
	listen 80;
	server_name pusheng.rails365.net;
	root /home/hfpp2012/pusheng/current/public;
	keepalive_timeout 70;

	location /.well-known/ {
	  root /home/hfpp2012/pusheng/current/public;
	}

	location ~ ^/assets/ {
	   gzip_static on;
	   expires max;
	   add_header Cache-Control public;
	}
	
	try_files $uri/index.html $uri @pusheng;
	location @pusheng {
	      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	      proxy_set_header Host $http_host;
	      proxy_redirect off;
	      proxy_pass http://pusheng;

	      #proxy_http_version 1.1;
	      #proxy_set_header Upgrade $http_upgrade;
	      #proxy_set_header Connection "upgrade";
	}
	error_page   500 502 503 504  /50x.html;
	location = /50x.html {
	    root   html;
	}
}