Last active
December 16, 2015 15:49
-
-
Save rcknight/5458996 to your computer and use it in GitHub Desktop.
Eventstore nginx config notes
This file contains 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
//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