Skip to content

Instantly share code, notes, and snippets.

@satooshi
Last active October 30, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satooshi/608fd70c19cff35f4981 to your computer and use it in GitHub Desktop.
Save satooshi/608fd70c19cff35f4981 to your computer and use it in GitHub Desktop.
unix socketを使う場合のnginxの設定
upstream backend {
server unix:/home/vagrant/prj/blog/tmp/sockets/puma.sock;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/vagrant/prj/blog/public;
index index.html;
server_name localhost;
default_type text/html;
gzip_types text/html text/plain text/xml text/css
text/comma-separated-values
text/javascript application/x-javascript
application/atom+xml;
# serve static files by nginx
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires 1y;
}
# deny dot files
location ~ /\..+ {
deny all;
}
# serve app by puma
location / {
if (!-f $request_filename) {
proxy_pass http://backend;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment