Last active
August 29, 2015 13:59
-
-
Save chroju/10534735 to your computer and use it in GitHub Desktop.
Nginx、sites-availableに配置、Railsをサブディレクトリ下で展開するための設定
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 unicorn-of-my-app { | |
| server unix:/var/www/Rails-app/shared/tmp/sockets/unicorn.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name www.chroju.com 192.168.1.1; | |
| root /var/www/home; | |
| access_log /var/log/nginx/home.log; | |
| error_log /var/log/nginx/home.log; | |
| location /Rails-app { | |
| alias /var/www/Rails-app/current; | |
| try_files $uri $uri.html $uri/index.html @unicorn-of-my-app; | |
| } | |
| location @unicorn-of-my-app { | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_pass http://unicorn-of-my-app; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment