Skip to content

Instantly share code, notes, and snippets.

@starwels
Created January 15, 2019 22:46
Show Gist options
  • Save starwels/7c8809bc4efeaf940e5c4e0e5d2326e9 to your computer and use it in GitHub Desktop.
Save starwels/7c8809bc4efeaf940e5c4e0e5d2326e9 to your computer and use it in GitHub Desktop.
upstream puma {
server unix:///home/user/apps/meudominio/shared/tmp/sockets/certamei-puma.sock;
}
server {
listen 80;
server_name meudominio.com.br www.meudominio.com.br;
root /var/www/meudominio.com.br/html/;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
server {
listen 80;
server_name app.meudominio.com.br;
root /home/user/apps/meudominio/current/public;
access_log /home/user/apps/meudominio/current/log/nginx.access.log;
error_log /home/user/apps/meudominio/current/log/nginx.error.log info;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment