This is the first time reaching out to the community, and only after months of trial and error, a ton of googling, reading 4 of the Odoo textbooks, and all the documentation I can find I still haven't been able to figure this out this problem - and I think it's probably something simple, so I figured I'd reach out.
Here's the scenario:
-Odoo 14 Community edition running on an AWS EC2 instance
-9 Separate Companies
-9 Public Facing Websites
-All Websites / Companies Sharing the Same Database
-VM Running on Debian 10
The Problem:
Despite my best efforts, I can't seem to get web traffic to route to the front-end websites correctly! Everything routes to the "main" website when typing any of the domains for the 9 publicly facing websites... and I can't seem to figure out how to configure the web servers to work properly.
Configurations:
I used one of Bitnami's EC2 stacks to provision the instance to get started with the Apache2 as the web server, of which I've installed Nginx to act as a reverse proxy after researching the performance / security improvements while possibly solving this domain redirection problem but have not had any luck. From my understanding, with the Multi-site configurations in Odoo 14, this shouldn't be a problem - yet it persists.
-web.base.url points to the default localhost:8069, I've tried the approach of "logging into each site as the admin" and setting the "web.base.url.freeze" to True, which has yet to work correctly, and also have tried changing the localhost:8069 to point to a "odoo.website.com" type name, thinking it might avoid conflicts with the front-end side with no luck
-httpd.conf: Prior to installing Nginx, I configured the main file to point to the httpd-vhosts.conf file
-httpd-vhosts.conf: I've tried setting this file up with the *:80 & *:443, for each of the 9 domains in the same file. I've tried replacing the * with localhost, the public / static IP for 80 & 127.0.0.1 for 443, using the proxy pass directive to point to the respective localhost:8069 addresses, and longpolling addresses on port 8072, and and just about everything else you can think of with no luck in resolving the domains
-odoo-server.conf: I'm still confused on the whole "db filter" thing, since I have one database I'm not sure this would matter, is there is something I need to change here? Maybe with the %h or #d? I've tried setting the proxy to Yes and No, and ya - totally lost.
-Nginx: When setting up nginx.conf, I changed the ports of apache to :8080 & :8443, and configured he t9 individual server blocks in the sites-enabled folder for each site based on documentation, and also provisioned the ssl certs or Nginx as well - but am still not sure if I did it correctly.
-"Proxy" vs "SSL" configuration with Nginx: Perhaps I'm doing something wrong here with the directives in the Nginx Server Blocks, I've been getting errors relating to "multiple longpolling addresses", but since that's only used for the chat I wouldn't think it would impact my domain redirection problem - but regardless, it does seem I might be confused on how to properly configure Nginx on the "proxy" side of things vs the "SSL" side of things.
An Easy Problem to fix:
From what I can tell, my problem comes from my lack of knowledge as a developer / programmer / server admin / etc... And it seems there is a simple solution that would take 5 minutes if I just knew the way to configure these dang web servers correctly!
My background is on the entrepreneurial side of things, Odoo after researching many ERP solutions over the past 4 years, it seems - if configured properly - it could solve all of my problems and help manage all of these ventures I plan on building in the most cost-effective approach!
My main objective is to get these websites up and running so I can begin preparing for a major funding round in the next 3 months and have the technology infrastructure put together so I can organize these businesses and properly delegate the functions and get everything in operation! I've been down many rabbit holes, and I'd say I've learned enough about the enterprise architecture side of things, but through this "cowboy development" approach - I'm at a roadblock until I figure out how to properly direct traffic to these damn domains!
Possible Solutions / Guidance:
I feel like I'm "almost there" although I've been saying that for the past 2 months and after having destroyed something like 20+ virtual machines on multiple cloud platforms - but I feel confident in my knowledge of what I've learned about how all this stuff ought to work. Perhaps, the best way someone could help would be to clarify the best practices around:
-How to properly configure the odoo-server.conf file to work with nginx in this scenerio
-What is the role of apache in all this? Doesn't Odoo have its own built-in webserver? Do I even need apache? If so, what do I need to do with apache's httpd.conf / httpd-vhosts.conf files?
-If I do need apache, how do I configure the server blocks with Nginx - how might they relate to vhosts in apache? Do I need to assign different internal IP addresses to the same port? Do I need one vhost in apache and multiple in Nginx? What are the directives / relationships between proxy server vs the ssl side of things and how might they be configured properly?
-What is the best practices in terms of databases? Should I have a different database for each site? Different databases for each company? It seems the simplest approach is my current configuration, as it seems having different databases would affect the tight integrations between the parent company(s) / subsidiaries between the front-end and back end... am I correct?
-What is the quickest and easiest way to make sure these domain addresses get resolved to the correct website?
Please let me know if there are any recommendations or advice! I feel it's a simple thing to solve, but with all of this "cowboy development" type shenanigans I need help pulling myself out of the rabbit hole!