I would like to proxy the requests. The address it should proxy is base url
+ whatever comes after it.
So the base url is https://10.10.10.10:8080
and if I send a request to http://localhost:9000/api/user
then it should be redirected to https://10.10.10.10:8080/api/user
. Can't achieve it.
So I have the following settings:
server {
listen 9000;
server_name localhost;
keepalive_timeout 70;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://10.10.10.10:8080/$request_uri;
}
}
And I get this as log:
127.0.0.1 - - [06/Jan/2021:08:27:02 +0100] "GET /api/user HTTP/1.1" 401 0 "-" "Java/1.8.0_221"
Seems like it forgets to add the ip address at the start...
Can anyone help me out?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…