I have a server which serves LuCI
for me on localhost:8080
. I'm trying to proxy to it via nginx, but I'd like to rewrite the URLs so that instead of https://myserver/cgi-bin/luci
, I have https://myserver/
.
Here's what I've got so far, which doesn't seem to be working:
upstream luci {
server localhost:8080;
}
server {
# ...
location / {
proxy_pass http://luci;
proxy_redirect / /cgi-bin/luci;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
However, with this configuration, I'm still seeing my urls prefixed with /cgi-bin/luci
, and they still work somehow.
How can I rewrite my incoming requests from https://myserver/^(.*)$
to http://luci/cgi-bin/luci$1
?
0 Answers