Skip to content

Instantly share code, notes, and snippets.

@EricLondon
Last active August 29, 2015 14:23
Show Gist options
  • Save EricLondon/df145895d5a3bacd2f7e to your computer and use it in GitHub Desktop.
Save EricLondon/df145895d5a3bacd2f7e to your computer and use it in GitHub Desktop.
IMS nginx & passenger
# I had nginx and passenger already installed via brew:
# note: this caused problems with RVM & gemsets
brew uninstall nginx passenger
brew cleanup
##########
# from the IMS rails project:
# note/todo: add to Gemfile?
gem install passenger -v 5.0.10
passenger-install-nginx-module
# Install options:
# - 1. Yes: download, compile and install Nginx for me. (recommended)
# - Please specify a prefix directory [/opt/nginx]:
# starting nginx
sudo /opt/nginx/sbin/nginx
# kill nginx
ps aux | grep -i nginx | grep -iv grep | awk '{print $2}' | sudo xargs kill
##########
# I also added my conf to a local git repo
cd /opt/nginx/conf
git init
git add .
git commit -am "initial commit"
➜ conf git:(master) ✗ git diff -w | cat
| diff --git a/nginx.conf b/nginx.conf
| index bb02f2e..d0dd7fa 100644
| --- a/nginx.conf
| +++ b/nginx.conf
| @@ -1,8 +1,8 @@
|
| #user nobody;
| -worker_processes 1;
| +worker_processes 4;
|
| -#error_log logs/error.log;
| +error_log logs/error.log;
| #error_log logs/error.log notice;
| #error_log logs/error.log info;
|
| @@ -37,16 +37,34 @@ http {
|
| server {
| listen 80;
| - server_name localhost;
| + server_name *.crowd.qsfllc.info *.cwe.qsfllc.info *.crowdwithease.dev;
|
| - #charset koi8-r;
| + root /apps/CrowdWithEase/public;
| + rails_env development;
| + passenger_enabled on;
| + access_log logs/crowdwithease.access.log;
| + error_log logs/crowdwithease.error.log;
|
| - #access_log logs/host.access.log main;
| + location /investors {
| + alias /apps/IMS-Frontend/build;
| + }
|
| - location / {
| - root html;
| - index index.html index.htm;
| + location /dashboard {
| + alias /apps/IMS-Frontend/build;
| }
| + location /css/ {
| + alias /apps/IMS-Frontend/build/css/;
| + }
| + location /js/ {
| + alias /apps/IMS-Frontend/build/js/;
| + }
| +
| + #charset koi8-r;
| +
| + #location / {
| + # root html;
| + # index index.html index.htm;
| + #}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment