Created
January 13, 2015 00:44
-
-
Save Nosfheratu/59c1eeeb0bb09b7b4261 to your computer and use it in GitHub Desktop.
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 { | |
server unix:/tmp/unicorn.my_app.sock fail_timeout=0; | |
} | |
server { | |
server_name my_app.com www.my_app.com; | |
listen 80 default deferred; | |
root /home/deployer/webapps/node/my_app/public; | |
try_files $uri/system/maintenance.html $uri/index.html $uri @unicorn; | |
location @unicorn { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://unicorn; | |
} | |
location ^~ /assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
add_header Access-Control-Allow-Origin *; | |
} | |
error_page 500 502 503 504 /500.html; | |
client_max_body_size 4G; | |
keepalive_timeout 10; | |
} |
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
sudo apt-get update | |
sudo apt-get upgrade (i guess this is corrupting postgresql installation) | |
sudo apt-get install curl vim build-essential python-software-properties git-core | |
sudo apt-get install imagemagick libmagickwand-dev | |
addgroup admin | |
adduser deployer --ingroup admin | |
deployer: | |
sudo add-apt-repository ppa:nginx/stable | |
sudo apt-get update | |
sudo apt-get install nginx | |
sudo service nginx start | |
sudo mkdir /home/deployer/webapps/node | |
sudo chgrp -R admin /home/deployer/webapps/node | |
sudo chmod -R g+rwxs /home/deployer/webapps/node | |
mkdir /home/deployer/webapps/node/my_app | |
sudo nano /etc/nginx/sites-available/my_app | |
(add nginx server configuration here, follow nginx_recipe) | |
sudo ln -s /etc/nginx/sites-available/my_app /etc/nginx/sites-enabled/my_app | |
sudo rm /etc/nginx/sites-enabled/default | |
sudo service nginx restart | |
(if there are issues regarding nginx start, you can check these with "tail -f /var/log/nginx/error.log" or "$ cat /var/log/nginx/error.log". Maybe you should/must, in /etc/nginx/nginx.conf, to uncomment "server_names_hash" section(s) and set it to 256) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment