warden
warden copied to clipboard
Problems with multiple websites with multiple top level domains
I followed https://docs.warden.dev/configuration/multipledomains.html?highlight=multiple#multiple-domains to make sure that my domains app.base.test
and app.alternative.test
are handled correctly.
Step 2 of this documentation links both domains to the same warden project as far as I understand.
Now I want to set the proper MAGE_RUN_CODE
in Magento1 resp. Magento2 based on the incoming domain.
In Magento 1 I try to use a custom nginx.conf
file to set the correct code.
This is included in images/nginx/context/etc/nginx/conf.d/default.conf
inside the server block.
But whatever I do there, I can not add a new server in my custom configuration to handle the traffic accordingly and with location
blocks I'm not able to get the top level domains, as I only have access to the URI there. Is there a way to solve that, which I did not get yet?
If not, it would be great to have the possibility to add a custom server block for that issue. So maybe we could add a new include
statement outside the server block?
In Magento2 I followed the approach including app/etc/stores.php
.
Unfortunately the host is already app.base.test
, when I call app.alternative.test
at this point.
So it seems as if this has been changed already by the .warden/warden-env.yml
adaption.
Am I missing something here as well or does the Magento2 approach only work for domains like domain1.exampleproject.test
and never for completely different top level domains?
I could really use a bit of help here. Could someone give a short hint what I could check / adapt?
@davidalger Do you see any possible solutions to this?
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I'm new to Warden and also interested in a solution for this scenario.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
@davidalger mind having a look at this?
@davidalger , it would be awesome to get some help here, as this issue is really bugging us. Maybe you have a small hint, what we could try? Then we will be happy to dive deeper into that and also prepare a PR for the docs
@davidalger I'm stucked as other people here as well. Somebody has maybe found a way to have it working?
@maverickk89 , we actually got it to work now, but did not find the time to add it to the docs. You need to create a '.warden/warden-env-yml' with the following content:
version: "3.5"
services:
varnish:
labels:
- traefik.http.routers.${WARDEN_ENV_NAME}-varnish.rule=
HostRegexp(`{subdomain:.+}.{{YOUR_ALTERNATIVE_URL}}.test`)
|| Host(`${TRAEFIK_DOMAIN}`)
|| Host(`{{YOUR_ALTERNATIVE_URL}}.test`)
|| HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`)
nginx:
labels:
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.rule=
HostRegexp(`{subdomain:.+}.{{YOUR_ALTERNATIVE_URL}}.test`)
|| Host(`${TRAEFIK_DOMAIN}`)
|| Host(`{{YOUR_ALTERNATIVE_URL}}.test`)
|| HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`)
Then you only need to run warden sign certificate {{YOUR_ALTERNATIVE_URL}}.test
and you should be ready to go.
Feel free to get in touch with me, if you need further help at a specific point.
I created a PR which adds this to the documentations.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.