Skip to content

Instantly share code, notes, and snippets.

@rcknight
Last active December 16, 2015 15:49
Show Gist options
  • Save rcknight/5458996 to your computer and use it in GitHub Desktop.
Save rcknight/5458996 to your computer and use it in GitHub Desktop.
Eventstore nginx config notes
//install nginx
sudo apt-get update
sudo apt-get install nginx
---------
//make a folder for our cache to live in
sudo mkdir /var/www
---------
sudo vim /etc/nginx/nginx.conf
//in http section
proxy_cache_path /var/www/cache levels=1:2 keys_zone=es-cache:8m max_size=1000m inactive=600m;
proxy_temp_path /var/www/cache/tmp;
//for better performance
access_log off;
---------
sudo vim /etc/nginx/sites-available/event-store
server {
listen <port>;
server_name <hostname>;
location / {
proxy_pass http://<eventstore ip>:<eventstore port>;
proxy_cache es-cache;
}
}
---------
//disable the default site
sudo rm /etc/nginx/sites-enabled/default
//enable the eventstore site
sudo ln -s /etc/nginx/sites-available/event-store /etc/nginx/sites-enabled/event-store
---------
//start nginx
sudo service nginx restart
//More reading
- http://wiki.nginx.org/Pitfalls
- http://wiki.nginx.org/QuickStart
- http://wiki.nginx.org/Configuration
- http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment