Rewriting parts of arguments in a URL

So for the moment, I’m having a little issue, and I’m not sure if there’s a way to do this, or if this is very specific to how I’m trying to accomplish this.

I currently have a URL from an application I’m running behind a reverse proxy providing the following:

If you notice, theres an argument for param that is a local IP URL. Is there any way to, say, take out the from that and change to the public IP of the server, even if I have to hard-code it into the rewrite?

Hi @miguelr, welcome to the Caddy community.

This should be possible, especially if you’re willing to hardcode it.

What’s your caddy -version ?


Caddy v1.0.3 (h1:i9gRhBgvc5ifchwWtSe7pDpsdS9+Q0Rw9oYQmYUTw1w=)

The rewrite docs are here:

You’ll want to rewrite with a regexp that captures the variable parts of the URL and write the target URL with the correct IP address.

If you include a substring check like if {uri} has, you’ll save your web server a few ticks of processing power running regex checks on all your requests.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.