public
Created

Facebook app with Erlang via Chicago Boss (series step 1)

  • Download Gist
Nginx Config - Localhost
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
server {
listen 8443;
server_name myprojectname.dev;
ssl on;
ssl_certificate /usr/local/certs/local_cert.pem;
ssl_certificate_key /usr/local/certs/local_key.pem;
ssl_session_timeout 5m;
server_name myprojectname.dev;
access_log /srv/www/myprojectname/shared/log/access.log;
error_log /srv/www/myprojectname/shared/log/error.log;
location / {
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_connect_timeout 74; # max is 75s
proxy_redirect off;
# Proxy to Backend (Simple Production will differ)
proxy_pass http://127.0.0.1:8001;
}
}
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#Edit hosts add entry for myprojectname.dev agsint 127.0.0.1
 
#Install nginx via brew
brew update
brew install nginx
 
#Scan config, alter as needed
vi /usr/local/etc/nginx/nginx.conf
 
#Assuming we leave it on port 8080, you can start nginx now.
/usr/local/sbin/nginx
 
#Reload and verify it's up, visit http://myprojectname.dev
/usr/local/sbin/nginx -s reload
 
#SSL - locally
mkdir -p /usr/local/certs && cd /usr/local/certs
openssl genrsa -out local_key.pem 2048
openssl req -new -x509 -key local_key.pem -out local_cert.pem -days 3650
#Ensure Common Name (eg, YOUR name) []: = myprojectname.dev (or equiv)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.