'Nginx Proxy Pass dont acceppts user & password

i need to proxy pass one URL from my internal network, that looks like this here:

http://<user><passwd><ipaddress>:<port>/cgi-bin/mjpg/video.cgi?channel=1&subtype=1

But this configuration always ends up in an error:

nginx: [emerg] invalid port in upstream "user:[email protected]:8080/cgi-bin/mjpg/video.cgi?channel=1&subtype=1" in /etc/nginx/sites-enabled/default:15
nginx: configuration file /etc/nginx/nginx.conf test failed

The only working way i get nginx to work is this one:

server {

listen 80;
root /var/www/html;
index index.php index.html index.htm;
                
location /video.cgi {
    proxy_pass http://192.168.133.122:8080/cgi-bin/mjpg/video.cgi?channel=1&subtype=1;
    }
}

But in this configuration the User and the Password are not included. Is there a way to get user&password also in the proxy_pass?

thanks Franz



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source