0

I want to create a reverse proxy to access my ip camera (10.10.10.31). But for some reason when I try to change my location from "/" to "/cam1" I get a 400 bad request. I can see it is trying to acces 10.10.10.31/cam1 but that does not exist.

How can I make it possible to go to someWebsite/cam1 and then get redirected to 10.10.10.31/

This works:

server {
    listen 50000;
    server_name someWebsite;

    location / {
    proxy_pass http://10.10.10.31/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
    error_log /var/log/nginx/debug.log debug;
}

This does not work:

server {
    listen 50000;
    server_name someWebsite;

    location /cam1 {
    proxy_pass http://10.10.10.31/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
    error_log /var/log/nginx/debug.log debug;
}

0 Answers0