I have publish my asp.net core web app on azure and assigned custom domain to my web app such as www.example.com and example.com. I have changed the CNAME, A and TXT record and added my hostname without issue. However, the non-www, example.com, sometimes work and sometimes it doesn't and i get an Error 404 - Web App not found. The www.example.com is always working and i don't have any issue. I tried on multiple device and computers, different web browsers and sometime everything is fine for the non-www rule but sometime i get that 404 Error. What could possibly be the issue?
These are the records i added:
A Record:
www, # and *
Txt Record:
www, # and *
CNAME Record:
www, *
On your DNS registrar, in addition to 'www' A record, you have to create a host A record with key '#' (meaning everything else) pointing to your azure external IP address. Thus example.com must work properly.
Related
I have domain example.com pointing to Azure Application Gateway
In Application Gateway I use url based routing which routes traffic to Azure App Service (blog.azurewebsites.net), and ssl termination.
App Service this is wordpress site with WP_SITEURL and WP_HOME set to "example.com".
Now, if I go to:
https://example.com/post/ - works well
https://example.com/index.php - works well
https://example.com - redirect loop takes place
I run the WP Site on Azure App Service with Linux Environment.
Once I access my domain with HTTPS and the $_SERVER['REQUEST_SCHEME'] return 'http' instead of 'https'. It caused the problem is the WP Site loads all images, css, js.. with http
I fixed my case with these lines in wp-config.php file.
$_SERVER['HTTPS'] = 'on';
$_SERVER['REQUEST_SCHEME'] = 'https';
Can you try https://example.com/? (with the slash in the end).
Without slash, I guess it is not matching the path based rules.
I've got an asp.net website (let's say http://cdn.mysite.com) hosted on IIS and sat behind an Amazon CloudFront Distribution (using a CNAME to access the cdn.* url above, let's say the distribution URL is http://mysite.cloudfront.net).
If a user hits a folder/directory url without a trailing slash, the server will issue a redirect to the origin cdn url, so if a user navigates to http://mysite.cloudfront.net/thanks, they'll end up on http://cdn.mysite.com/thanks/ instead of http://mysite.cloudfront.net/thanks/
Any suggestions of how to fix this in asp.net / iis / cloudfront?
You're right - and rather than fighting it - have you configured CloudFront to whitelist host headers?
For each behaviour > Forward Headers > Select 'Whitelist' > Select 'Host' from the list and hit Add.
This setting ensures that the host header (mysite.cloudfront.net) is included in requests back to the origin (so make sure you've added mysite.cloudfront.net to your site bindings). I'd expect the redirect issued by IIS will use the correct domain name once this configuration is in place.
I have a domain running
http://www.exampledomain.com
and I have a subdomain that is working correctly at
http://mysub.exampledomain.com
both have web pages being served by nginx and I am able to hit both of those without a problem.
I have another domain that I want to point at that subdomain so it serves the same pages without redirecting the url.
http://www.myotherdomain.com
On that domain I setup these records
host name: www
ip address/url: mysub.exampledomain.com.
record type: CNAME (alias)
host name: #
ip address/url: mysub.exampledomain.com.
record type: CNAME (alias)
Now when I try to load http://www.myotherdomain.com I get a 400 error coming from nginx. Because it's an nginx error I'm assuming the dns is making it through but I could be wrong. Do I need to do something to let nginx or ubuntu be ok with serving requests from this domain? Modify my hosts file or something?
Edit: Now that it's been a little bit I'm no longer getting the error but It's loading the content of my first url. So using the psuedo domains above... www.myotherdomain.com is now loading the content of www.exampledomain.com instead of mysub.exampledomain.com
I was able to get this working by changing my record types from CNAMEs to URL frames. If anyone has more knowledge on the subject I would still love to know why my previous setup was causing nginx errors and this one isn't.
For a Meteor JS deployment, how do your point domain.com at the same deployment as www.domain.com?
I have the A record pointing at the same IP address as www., but I'm getting the "there is no site deployed at this address message":
http://emiliotelevision.com
It appears Meteor's servers are not smart enough to make the site on www.emiliotelevision.com, which is working, also work for the equivalent with out the www..
Is there a better solution for this than pointing at another one of your own servers configured to redirect to the www. version?
Use a CNAME record for both www.emiliotelevision.com and emiliotelevision.com that points to yourserver.meteor.com
You need to set a domain redirect. emiliotelevision.com should redirect to www.emiliotelevision.com.
Now you can meteor deploy to www.emiliotelevision.com.
You may be able to set up the redirect from where you purchased the domain main.
I am having problems using a subdomain and ASP.NET, I guess it must be something very simple I just do not know what.
If you would like to go right to the point just jump to no. 7 below...
TVM, RConte
My hosted domain:
Hosted Service Domains: MYDOMAIN.net
Added a subdomain: (rfpesquisa)
Sub Domains
Sub Domain Remove
rfpesquisa Remove [THIS ONE]
Added a "A" record in DNS [see below]
Hosted DNS MYDOMAIN.net
$ORIGIN MYDOMAIN.net.
$TTL 86400
.....etc
rfpesquisa 86400 IN A 174.36.13.167 [THIS ONE, COPIED FROM...]
www 86400 IN A 174.36.13.167 [...THIS ONE]
TESTS MADE:
Acessed main page (not the subdomain) as usual:
(http://)www.MYDOMAIN.net/AcessaPesquisa.aspx
works fine !
Added a "kkk" so as to make for a wrong url:
(http://)www.MYDOMAINkkk.net/AcessaPesquisa.aspx
gives:
"Could not locate remote server" [as expected]
Tried a non-existing subdomain, XXXXXX
(http://)XXXXXX.MYDOMAIN.net/AcessaPesquisa.aspx
gives:
HTTP Error 404. The requested resource is not found.
[witch means to me that the server was found but the subdomain per se was not found]
Tried what I am look for dooing: (used the subdomain rfpesquisa)
(http://)rfpesquisa.MYDOMAIN.net/AcessaPesquisa.aspx
Message I got:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /AcessaPesquisa.aspx
given that ASP.NET Message, it means to me that
--the subdomain WAS found,
the request was given to ASP.NET dll, only
it is NOT pointing to the same place as the domain, otherwise
the results for this try and no.4, the rigth one, would be the same.
file "AcessaPesquisa.aspx" is NOT in the target directory.
Please, how do I point the subdomain to the right place ?
Thank you very much,
Ricardo Conte
I guess
(1) you are using pan-domain service (one of DNS registry, redirecting requests to all sub-domains *.mydomain.net to the same server)
AND
(2) in your IIS configuration of this server, you've bound the website and the host name "www.mydomain.net" together.