Traefik config for custom customer portal url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GeneraalSnor
    Junior Member
    • Aug 2024
    • 10

    #1

    Traefik config for custom customer portal url

    Server setup:
    - Traefik with Dokploy
    - EspoCRM Docker container

    I am running currently the EspoCRM on subdomain1.domain.com which is working fine.
    We now want to setup a customer portal at subdomain2.domain.com (without the /portal/<portal id>). I have been trying a lot of options but can't get the custom customer portal url working. The subdomain2 is loading correctly but behaves just exactly as subdomain1, i.e. subdomain2.domain.com is pointing to the main EspoCRM, whereas /portal/<portal id> is loading the customer portal.
    Anyone that could give some guidance on how to achieve it?

    Is it i.e. possible to achieve this by setting up the necessary labels for Traefik and it will work? If not, what files and configurations need to be changed? Have been looking into the EspoCRM documentation but can't get around it..

    Any help or guidance is very much appreciated!
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1850

    #2
    this is, what Google Gemini spit out:
    Hosting an EspoCRM portal on a dedicated subdomain (e.g., portal.yourdomain.com) while the main CRM runs on another (e.g., crm.yourdomain.com) is possible and recommended for separating traffic and preventing session conflicts.
    EspoCRM +2
    Here is how to set up an EspoCRM portal on its own subdomain:
    1. Configure the Portal in EspoCRM
    1. Navigate to Administration > Portals and create a new portal.
    2. In the Portal record, set the Custom URL field to your desired subdomain (e.g., https://portal.yourdomain.com).
    3. Note the Portal ID from the URL (e.g., 16b9hm41c069e6j24).
      EspoCRM Documentation +2
    2. Server Configuration (Apache/Nginx)
    The subdomain must point to the same installation files as your main CRM, but with a different root configuration to handle the URL redirection.
    • Apache: Create a new Virtual Host for the subdomain. The DocumentRoot should point to the same directory as the main instance. The crucial part is adding the necessary <Directory> block to allow .htaccess to handle the rewrite rules.
    • Nginx: Configure the server_name to the subdomain. The root directory must point to your EspoCRM installation, and you need to add specific location blocks to handle the portal redirection, typically setting up rewrite ^/(.*)$ /portal/ last;.
      EspoCRM +4
    3. Key Considerations
    • SSL/HTTPS: Ensure your subdomain has a valid SSL certificate.
    • Session Conflicts: Using a subdomain prevents issues where a user logged into the main CRM cannot log into the portal in the same browser.
    • Asset Loading: If the portal loads without styles, ensure your symlinks (like /client to /portal) are correct, as some setups require careful handling of JS/CSS loading for custom domains.
    • Testing: After configuring, visit https://portal.yourdomain.com to confirm it loads the login screen for the specific portal.
      EspoCRM +3

    Comment

    • GeneraalSnor
      Junior Member
      • Aug 2024
      • 10

      #3
      Thank you for the suggestions.

      I have started from scratch and seems like almost there now with a new VirtualHost config. Only images won't load, any suggestions to resolve that?

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1850

        #4
        Why do they not load? Anything in log file? (data -> logs).
        On opening a view, hit F12 for Browser tools -> Console. Are there any errors?
        Folder permissons set correctly.
        May be several reasons.

        Comment

        Working...