Created
March 6, 2013 07:42
-
-
Save anonymous/5097458 to your computer and use it in GitHub Desktop.
foscam ip cameras behind nginx
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
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