0
Z odpowiedzią

Reverse Proxy to other subdir behind nginx

Frank Kubis 9 lat temu Ostatnio zmodyfikowane przez Eugene Pankov (Project coordinator) 9 lat temu 2
Hi,

iIs it possible to run ajenti in other subdir as /ajenti using reverse proxy with nginx?
I would like to run it under /web1, because I would like to set up a second server with ajenti and the same domain. But I got only one valid certificate, so need to change the name.

Using latest nginx, I tried:

location /web1 {
rewrite (/web1)$ / break;
rewrite /web1/(.*) /$1 break;
rewrite ^/(.*)/$ /web1/;
proxy_pass http://127.0.0.1:8000;
proxy_redirect / /web1/;
proxy_set_header Host $host;
proxy_set_header Origin http://$host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}

But it uses still /ajenti:, it should be /web1/ajenti:.

Odpowiedź

Odpowiedź
Z odpowiedzią
This isn't possible, because Ajenti pages include absolute /ajenti:.* URLs.
NIEDOBRZE, NIE JESTEM ZADOWOLONY
Mhm thats bad, any idea how to resolve my problem?
Znak zadowolenia przez Frank Kubis 9 lat temu
Odpowiedź
Z odpowiedzią
This isn't possible, because Ajenti pages include absolute /ajenti:.* URLs.
I think it might be possible to proxy to different hosts based on port - e.g., host:443/ajenti/ and host:444/ajenti/ with the same certificate