Skip to content

Instantly share code, notes, and snippets.

Created March 6, 2013 07:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5097458 to your computer and use it in GitHub Desktop.
Save anonymous/5097458 to your computer and use it in GitHub Desktop.
foscam ip cameras behind nginx
server {
listen 443;
server_name cameras.example.com;
root /web/cameras;
ssl on;
ssl_certificate /web/cameras/cameras.crt;
ssl_certificate_key /web/cameras/cameras.key;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
# local ips require no password
auth_basic "Private Network";
auth_basic_user_file /web/cameras/.htpasswd;
satisfy any;
allow 192.168.0.0/16;
deny all;
location /cam1/stream {
proxy_pass http://192.168.0.11/videostream.cgi;
proxy_set_header Authorization "Basic ABC123=";
}
location /cam2/stream {
proxy_pass http://192.168.0.12/videostream.cgi;
proxy_set_header Authorization "Basic ABC123=";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment