Custom domain for each business

v5.10.48

Hey guys,

I have the latest self hosted version installed on invoice.MAINBUSINESSNAME(DOT)com (this is the parent company)

I am trying to setup different businesses (using wordpress) to sell products (ie: BUSINESS1(DOT)com) and offer rentals (ie: BUSINESS2(DOT)com).

Id like to be able to mask and use invoice.BUSINESS1(DOT)com (or any other domain) without installing an entirely different invoice ninja on this subdomain.

I am looking to basically manage all businesses in the parent company domain but masking the pages (such as invoice links, etc) with the BUSINESS1(DOT)com domain name when its being linked on the BUSINESS1(DOT)com website or when customers make a purchase. I would like to hide any and all reference of invoice.MAINBUSINESSNAME(DOT)com

Is this possible? I do see the “client portal” area that allows you to set the domain, but I have no idea what the next step are. and if this is what the solution is. Am I supposed to setup cnames for each page? For example, If I enter sales.BUSINESS1(DOT)com for the portal domain, what is required to be done next?

Please advise, thanks

As far as I understand it, the easiest way to do this would be to setup a custom nginx config file that uses each of the three separate URLs that you wish to use. You can also setup multiple businesses within a single InvoiceNinja installation. I believe (@hillel may need to confirm this) you can then point your nginx config to the specific InvoiceNinja directory for that company. Otherwise, all three businesses would be managed under the single install.

You may also need to setup specific CNAME entries to point from the URL to the specific IP address for InvoiceNinja.

Is that what you are inquiring about?

Hi @northhill thanks for the response. Confused on your response, check out below:

Invoice ninja installation domain- invoice.MAINBUSINESS(dot)COM

Add company: BUSINESS1
Create a masked invoice ninja URL: sales.BUSINESS1(dot)com - I am assuming this is where client portal comes in?

Connect BUSINESS1(dot)com (Wordpress site) with invoice ninja plugin specifically to sales.BUSINESS1(dot)com to receive product info etc to post on site for sale with invoice ninja wordpress plugin. This URL should also be the URL to send invoices (with domain sales.BUSINESS1(dot)com) instead of invoice.MAINBUSINESS(dot)com

Id like to repeat the same process with BUSINESS2 etc.

Is this possible?

Yes, you can use the WordPress plugin with InvoiceNinja to sell goods and services. Within your invoice.mainbusiness.com installation of InvoiceNinja, you can setup multiple businesses. It’s not restricted to only one business. If mainbusiness.com, business1.com, and business2.com are three separate, legal entities, then you can set them each up as individual businesses within one install of InvoiceNinja. Even if they are all different names and services for the same business entity, you can set them up separately within InvoiceNinja, but you don’t have to. Though, I suspect it may be easier if you did.

I don’t know that you need to use domain masking, hence my previous reply. By creating a custom nginx (or a custom Apache2) config, you can use all three of your domains, while pointing them at the same InvoiceNinja resource. You’ll also need to setup your DNS to function with this as well. Not to mention, it can mitigate for some of the complexities and problems with domain masking.

1 Like

Hi! Thanks for the response and insight. Is this native in invoice ninja? There arent instructions for the client portal and how it works. How does that section actually work and how to set it up? Is it meant to do what I am aiming for? Im confused on this.

Ideally id like to manage them all in once place, but id like the links (when sending and approving invoices) to be the invoice.business1(dot)com or invoice.business2(dot)com domain instead of invoice.mainbusiness(dot)com

I can set it up as proxy with nginx, but when emails and links are sent, I am under the impression its going to be under invoice.mainbusiness(dot)com, which then would defeat the purpose.

Any insight?

Hey

Fixed the issue. Just as @northhill mentioned - It required me to create a custom nginx proxy for the domain invoice.BUSINESSNAME1(dot) and point it to the invoice.MAINBUSINESSNAME(dot)com. For example, invoice.BUSINESS1(dot)com would be setup as the following in NGINX proxy


location / {
proxy_pass https://invoice.MAINBUSINESSNAME(DOT).com;
proxy_set_header Host invoice.MAINBUSINESSNAME(DOT)com; # Explicitly set target host
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

Apply this to any domain you’d like to add as a business/company and invoice ninja masks / picks it up properly for client portal. It ends up working with the custom domain you create in client portal.

Hope this helps. Keep up the great work guys

1 Like