Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (32 sloc) 1.33 KB
upstream puma {
server unix:///home/ubuntu/[YOUR_APPLICATION_FOLDER]/tmp/sockets/puma.sock;
}
server {
listen 80;
server_name [YOUR_DOMAIN_NAME.COM]; # change to your live domain
root /home/ubuntu/[YOUR_APPLICATION_FOLDER]/public;
location / {
proxy_pass http://puma; # this should match the name of upstream directive
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* ^/assets/ {
# Per RFC2616 - 1 year maximum expiry
expires 1y;
add_header Cache-Control public;
# Some browsers still send conditional GET requests if there's a
# Last-Modified header or an ETag header even if they haven't
# reached the expiry date sent in the Expires header.
add_header Last-Modified "";
add_header ETag "";
break;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/[YOUR_DOMAIN_NAME.COM]/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/[YOUR_DOMAIN_NAME.COM]/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}