Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFD Configuration for custom domains doesnt work by default #84

Open
nsp37 opened this issue Jun 27, 2023 · 3 comments
Open

AFD Configuration for custom domains doesnt work by default #84

nsp37 opened this issue Jun 27, 2023 · 3 comments

Comments

@nsp37
Copy link

nsp37 commented Jun 27, 2023

When setting AFD_CUSTOM_DOMAIN setup doesnt tackle (or define steps to):

  • Remove the old assigned domain from the route
  • Add Forward Host Header
  • Add the domain to the AppService so it accepts the HOST header traffic matching the custom domain
@karpikpl
Copy link

karpikpl commented Aug 2, 2023

hey @nsp37 I think this might be related to issue I just opened #92
Can you provide more details what configuration you've added in AFD?

@nsp37
Copy link
Author

nsp37 commented Aug 3, 2023

In AFD under the Route - you can hardcode the forwarded HOST header - you need to set this to the custom domain. It defaults to the AFD original hostname so Wordpress will redirect you infinitely.

To get AppService to accept the host heaader you have to then add the Custom Domain there as well - but only validate it, do not bind it.

@karpikpl
Copy link

karpikpl commented Aug 3, 2023

Hey,
Thanks for your help!

I tried something similar but I'm getting lost in the wordpress space and can't get any logs out of WP.

My Setup is:

AFD:

  • route for custom domain site1.foo.com to Azure App Service with origin group that has Origin Host Header set to site1.foo.com (instead of wordpress-foo.azurewebsites.net). Origin Path is set to /site1

App Service

  • added domain site1.foo.com - validated without CNAME

WP:

  • Config:
    • WORDPRESS_MULTISITE_TYPE - subdirectory
    • WORDPRESS_MULTISITE_CONVERT - true
  • Network manager - added site1
  • In site1 settings changed site Address (URL), home and siteurl to https://site1.foo.com

Is that correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants