Wrong internal links to localhost

I installed invoice ninja on my server behind nginx reverse proxy with SSL. It works perfectly well, specially on almost all pages which are served to the ‘#/’ URI. The problem arrives when I try to access the client portal on the client page. It loads the page, but not any image or link there because they are linked to ‘’ and not to my domain. On developer tools, I see that a file called ‘pdf.min.js’ is also not downloaded because it tries to fetch from ‘’, but it doesn’t bring me problems because I can still open and view pdf reports.

I tried multiple nginx configurations and changing the env file with no success. the APP_URL env is my domain name and TRUSTED_PROXIES was tried with ‘*’ as well with my external ip address as suggested on this post: Internal IP in some links

It seems invoiceninja server pulls the host address from anywhere where is not set or set to localhost. Can someone explain where does it get the value from? I did a ripgrep on ‘127’ on the invoice server directory and it seems it is not hardcoded anywhere, so I supect invoiceninja gets from any variable but I can’t find which.

It doesn’t seem to be related to the reverse proxy because the exact same problem happens when I access invoiceninja on my LAN or my VPN over regular http, which doesn’t pass thru the reverse proxy. It is installed in a docker container, so this may be related.

Anyone knows where does invoice ninja gets the host from to from the url on links presented in the html? Can anyone suggest a solution?

Thank you,


@david any thoughts?

I don’t think this is invoice ninja as such, but the proxy configuration

I think I discovered the problem. It seems invoiceninja was created in such a way that you should to use default 80 and 443 . I use others because my residential ISP blocks those. The client portal is an interesting feature, but not essential. If one day I feel the need, I will go to a provider who doesn’t block default ports.