upstream REPLACEMEAPPNAME { # Path to Puma SOCK file, as defined previously server unix:/home/REPLACEMEUSERNAME/REPLACEMEAPPNAME.sock fail_timeout=0; } server { listen 80; listen 443 ssl; server_name REPLACEMEAPPNAME.meroku.com; #ssl on; # ssl on; tells NGINX to server ANY content through SSL. ssl_certificate /home/ubuntu/.meroku/letsencrypt_fullchain.pem; ssl_certificate_key /home/ubuntu/.meroku/letsencrypt_privkey.pem; root /home/REPLACEMEUSERNAME/REPLACEMEAPPNAME/public; try_files $uri/index.html $uri @REPLACEMEAPPNAME; location @REPLACEMEAPPNAME { proxy_pass http://REPLACEMEAPPNAME; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; }