Linked images / reverse proxy

Discussion in 'Common issues' started by forsit, Oct 8, 2019 at 3:32 PM.

  1. forsit

    forsit New Member

    Joined:
    Sep 14, 2018
    Messages:
    6
    Likes Received:
    0
    S.E:
    2020-03-25 03:12:19
    L.T:
    Regular
    L.C:
    2
    Hello,

    We have an issue with linked images with the following setup:
    Problem: when a campaign is sent, all linked images included in sent e-mails have a URL of the following form: http://MACHINEB/newsletter/frontend/assets/files/customer/hs426wz7cx29e/Banner_Newsletter2.png
    So, all the images have a link which refers to the machine B, which is not accessible from the Internet. SO images are not available.

    Is there a proper way to solve this issue, like being able to set the "image base URL", or something else ? Is there a canonical way you would recommend for a setup with a reverse proxy ?

    ***
    Ours needs:
    • One public machine, acting as a reverse proxy. Does not hosts any application.
    • One protected machine, accessible only by the reverse proxy and intranet adresses.
    Thank you in advance for your answer.
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,354
    Likes Received:
    2,406
    @forsit - This is happening because machine A does not properly forwards the headers to machine B, which is typical in such setup.
    Nginx gives you a few options to forward this info which then machine B can fetch and use.
    You can also create a new file called init-custom.php in /apps/ folder and force $_SERVER['..'] values there.
     

Share This Page