Last active
October 30, 2015 15:28
-
-
Save satooshi/608fd70c19cff35f4981 to your computer and use it in GitHub Desktop.
unix socketを使う場合のnginxの設定
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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