API Metadata when behind Nginx proxy pass

Hi everyone, I have a ServiceStack V4.0.50 self-hosted web service sitting behind a Nginx reverse proxy (proxy pass), Nginx takes care of serving the requests for subdomains (e.g. local.mydomain.com) configurations looks like this fragment:

server {
    listen 443 ssl;
    server_name local.mydomain.com;

    location /api {
            proxy_pass http://127.0.0.1:9000/;
    }
}

Everything works fine except that the metadata page http://local.mydomain.com/api/metadata links are pointing to 127.0.0.1:9000, how can I tell the metadata page or the self-hosted host to use my http://local.mydomain.com/api for service docs/definitions?

You can configure it with a Config.WebHostUrl, e.g:

SetConfig({
    WebHostUrl = "http://local.mydomain.com/api"
});

Thanks mythz that was it!

We will add it to configuration so that it can be changed for multiple deployments.

1 Like