Reverse proxy a sprint-boot application to Postman mock server

1. Caddy version (caddy version):

v2.5.1 h1:bAWwslD1jNeCzDa+jDCNwb8M3UJ2tPa8UZFFzPVmGKs=

2. How I run Caddy:

I have a Caddyfile with the following configuration:

{
        debug
        # auto_https off
        log {
                output stdout
                level DEBUG
        }
        local_certs
}
http://localhost:25110 {
    reverse_proxy https://be4582db-9c24-4d99-b646-c6aebb65047d.mock.pstmn.io {
	}
}

a. System environment:

b. Command:

caddy start ./Caddyfile 

Note, its not in the same directory as my spring boot application

c. Service/unit/compose file:


d. My complete Caddyfile or JSON config:

{
        debug
        # auto_https off
        log {
                output stdout
                level DEBUG
        }
        local_certs
}
http://localhost:25110 {
    reverse_proxy https://be4582db-9c24-4d99-b646-c6aebb65047d.mock.pstmn.io {
	}
}

3. The problem I’m having:

I have a spring boot application that I am using as a backend service. I am trying to use caddy to reverse proxy to a postman mock server https://be4582db-9c24-4d99-b646-c6aebb65047d.mock.pstmn.io when that service is down. I can run the spring boot app locally on port 25110 or the hosted url. But, I can’t make reverse proxy to postman mock server.

4. Error messages and/or full log output:

{"error":{"name":"invalidCredentialsError","header":"Unable to authenticate","message":"Double check your access token and try again."}}

5. What I already tried:

All I want to do is redirect request to the spring boot api to my postman mock server.
I have tried diffrent configurations but nothing seems to redirect the request properly.

6. Links to relevant resources:

When proxying over HTTPS, you typically need to override the Host header to match the upstream’s domain:

This topic was automatically closed after 30 days. New replies are no longer allowed.