Skip to content

Instantly share code, notes, and snippets.

@mattfelsen
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfelsen/10221247 to your computer and use it in GitHub Desktop.
Save mattfelsen/10221247 to your computer and use it in GitHub Desktop.
Installing nginx on rPi for increasing video streaming performance
# Taken from these two posts
# Note, I did not enable php support in nginx to keep things simple
# http://www.raspberrypi.org/forums/viewtopic.php?p=515259
# http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=63276&p=502944&hilit=rpi+cam+web+interface+nginx#p502944
sudo apt-get install nginx
# edit nginx config
sudo nano /etc/nginx/nginx.conf
# disable gzip and logging for performance
gzip on
access_log /var/log/nginx/access.log
# edit nginx sites config
sudo nano /etc/nginx/sites-available/default
# add this line
listen 8080;
# and change root dir
root /var/www;
# comment out the location /doc/ block
# maybe not necessary but there was something about
# autoindexing so just to be convservative
# restart nginx
sudo /etc/init.d/nginx restart
# also this
sudo sed -i "s/worker_processes 4;/worker_processes 1;/g" /etc/nginx/nginx.conf
sudo sed -i "s/worker_connections 768;/worker_connections 128;/g" /etc/nginx/nginx.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment