Greetings!
I'm running nginx 1.7.9 on Windows 7 in order to provide secure access to two webcams. I have it working with one of the webcams, but what I'd like is to be able to do is, with nginx still listening only on 443 and using the same domain (whatever.example.com), proxy to the second camera by changing the url--by going to https://example.com/camb for example.
Here is what I believe is the relevant portion of my current nginx.conf configured for just the one camera and below are some other things I've already tried that have not worked.
server {
listen 443;
ssl on;
ssl_certificate ssl/myssl.crt;
ssl_certificate_key ssl/myssl.key;
location / {
proxy_pass http://internalip:port;
proxy_set_header host example.com;
}
}
I have tried adding a second location with /cam2 using the same config as in the location for "/", changing only the internal ip and port for the second location so that it points to the second camera. When I do that, I get a 404 error when attempting to access /cam2.
I also tried the below but still get a 404 error. I don't have anything else installed on the Windows box other than nginx--meaning no apache, IIS, perl, etc. I'm not sure if anything else is needed for the nginx rewrite module to function or not. I'm very much a noob at this.
location /cama {
rewrite ^/cama(.*) /$1 break;
proxy_pass http://internalipcama:port;
}
location /camb {
rewrite ^/camb(.*) /$1 break;
proxy_pass http://internalipcamb:port;
}
Any help would be appreciated. Thanks!
I'm running nginx 1.7.9 on Windows 7 in order to provide secure access to two webcams. I have it working with one of the webcams, but what I'd like is to be able to do is, with nginx still listening only on 443 and using the same domain (whatever.example.com), proxy to the second camera by changing the url--by going to https://example.com/camb for example.
Here is what I believe is the relevant portion of my current nginx.conf configured for just the one camera and below are some other things I've already tried that have not worked.
server {
listen 443;
ssl on;
ssl_certificate ssl/myssl.crt;
ssl_certificate_key ssl/myssl.key;
location / {
proxy_pass http://internalip:port;
proxy_set_header host example.com;
}
}
I have tried adding a second location with /cam2 using the same config as in the location for "/", changing only the internal ip and port for the second location so that it points to the second camera. When I do that, I get a 404 error when attempting to access /cam2.
I also tried the below but still get a 404 error. I don't have anything else installed on the Windows box other than nginx--meaning no apache, IIS, perl, etc. I'm not sure if anything else is needed for the nginx rewrite module to function or not. I'm very much a noob at this.
location /cama {
rewrite ^/cama(.*) /$1 break;
proxy_pass http://internalipcama:port;
}
location /camb {
rewrite ^/camb(.*) /$1 break;
proxy_pass http://internalipcamb:port;
}
Any help would be appreciated. Thanks!