Hi;
OpenWrt x86_64. I have a webrtc-streamer instance serving RTSP IP cameras at 192.168.1.8:8000 which is working on my local LAN, and, if I port forward, also on wan at mysite:8000. Now, I want to use name based as opposed to port redirection.
[code]
upstream video {
server 192.168.1.8:8000;
}
server {
listen 80;
listen [::]:80;
server_name rossco.org *.rossco.org;
location /.well-known/acme-challenge/ {
default_type "text/plain";
allow all;
alias /var/letsencrypt/;
}
location /cameras/ {
rewrite ^/cameras/.* $1 last;
proxy_pass http://video;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443;
listen [::]:443;
server_name rossco.org *.rossco.org;
...
}
[/code]
Intent is that www.rossco.org/cameras is re-written (strip cameras from url) and redirects to 192.168.1.8:8000.
What I am seeing is error 404, indicating location "cameras" not being recognized. No re-write.
Anyone want to throw me a bone?
Thanks;
Bill
OpenWrt x86_64. I have a webrtc-streamer instance serving RTSP IP cameras at 192.168.1.8:8000 which is working on my local LAN, and, if I port forward, also on wan at mysite:8000. Now, I want to use name based as opposed to port redirection.
[code]
upstream video {
server 192.168.1.8:8000;
}
server {
listen 80;
listen [::]:80;
server_name rossco.org *.rossco.org;
location /.well-known/acme-challenge/ {
default_type "text/plain";
allow all;
alias /var/letsencrypt/;
}
location /cameras/ {
rewrite ^/cameras/.* $1 last;
proxy_pass http://video;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443;
listen [::]:443;
server_name rossco.org *.rossco.org;
...
}
[/code]
Intent is that www.rossco.org/cameras is re-written (strip cameras from url) and redirects to 192.168.1.8:8000.
What I am seeing is error 404, indicating location "cameras" not being recognized. No re-write.
Anyone want to throw me a bone?
Thanks;
Bill