Enabling https on server for one site but not another - https

I have run into an issue when enabling https on a server that hosts many sites. I have only enabled https for one site (site1.com), but when a user tries to browse to site2.com which doesn't have https enabled, if they try to get to https://www.site2.com, it redirects to https://www.site1.com. Can I prevent this from happening?

You will need two IPs for that and host one site with a different IP.
The 'problem' is that SSL connection is established on IP basis through TCP before the HTTP Server gets the Request, which is then already encrypted. Since your SSL port is linked to site1 this site will be served.
If your DNS A-Records point to the same IP then the only way i see you could do this is either use two IPs or enter the URL of site2 with http://site2.com (explicitly without HTTPS). In that case the connection would be opened unencrypted on Port 80.
Setup two IPs use HTTPS for one and not the other.

Related

Should I redirect Https to http in alb aws?

So I have a load balancer connected to an ec2 instance. The ec2 has a php website running on port 8000 hosted in iis 8.5. Now http health check is passing after adding binding in iis for port 8000, but https health check is failing. But since in iis, I have used URL rewrite to redirect all http into https, thus even if load balancer's https health check is failing I can still access website on https connection.
But I really want to make my health check for https pass.
So for that I figured out, I either run https application inside ec2 on a different port than 8000 and add a binding for it (dropped the idea cause client didnot want) OR,
Redirect https target group to http target group.
Is this possible? If yes, how?

Is there a way to redirect CNAME www.mywebsite.com to https://www.mywebsite.com with ovh and heroku

I am hosting my nodejs app in heroku and my domain name is in OVH.
I managed to create a subdomain www and a CNAME record that points to my heroku app. It is working fine and SSL is also working fine from heroku.
I added a redirection from all subdomains to https://www.mywebsite.com and everything is working fine.
My problem is when i type www.mywebsite.com, there is no redirection and no SSL.
How can i redirect www.mywebsite.com to https://www.mywebsite.com ?
Thanks !
Unfortunately, No.
DNS maps domain names onto IP addresses, that is, it tells the client that example.com points to 12.34.56.78. HTTP vs. HTTPS is a matter of picking a port, and using the right protocol, and this is negotiated directly between client and server; DNS lookup has already happened before that.
If you want to redirect all plain-http traffic to https, you have to do it on the web server, not the DNS server.
In your situation, you could do this in node.js.
There tons of examples online for node's built-in http server or for frameworks like express. I'd recommend this solution.
But there are also solutions like Cloudflare.
They offer you a DNS Service and a proxy, which can handle such HTTP to HTTPS redirection and they even let you use their own SSL Certificate, so you don't need to buy (or let's encrypt) a SSL Certificate on your own, for example.

Redirect :80 to :443 (http to https) with Wakanda Server

I've set up a Wakanda server hosted on an Amazon EC2 instance, that has SSL certificates installed as per the Wakanda documentation and accessing the home page via https easily enough, but won't redirect incoming traffic on port 80 to 443 automatically.
Being an Amazon AWS instance with an elastic IP, I've tried to set up a load balancer to handle the traffic routing for me as a possible solution. Though while that reports that it's routing "Load Balancer Port = 80" to "Instance Port = 443", it doesn't seem to be redirecting traffic either.
I may be missing something entirely in the way the Load Balancer is supposed to work, but is there a way for the Wakanda Server to automatically route incoming http traffic to https? Edit: I have also tried to set up a .htaccess file in my webFolder directory to manually try to redirect traffic, though I'm finding very limited documentation around whether that is a viable option in itself too.
Thanks!

Why does HTTPS break my hosts file redirection?

There is a machine (let's call it Machine) with a hostname in my local network. If I go to abc.def.com, my DNS service resolves Machine's external IP and connects me successfully with https://. I've added a hosts file entry so that local.abc.def.com resolves to Machine's local, internal IP.
However, using https://local.abc.def.com breaks everything. I get ERR_CONNECTION_REFUSED in Chrome and This page can't be displayed in Internet Explorer. If I replace https:// with http://, it works again. What's going on?
I assume, for your abc.def.com machine you have https redirect configured with 443 port as well.
Based on description above your application/web server you are using
is not listening port 443 or there is a firewall rejecting your connection.

GoDaddy Multiple website hosted on Dedicated Server issue

I'm using my friend's dedicated server where he hosts 2 of his websites to host my own, but I'm not familiar with registering domains, and I can't get my domain to point to a specific port I use so that my website doesnt clash with his. He has 2 websites that according to IIS are using the SAME PORT, I installed XAMPP so I had to use the 8080 port, how did he register two different domains for websites hosted on the same ip under the same port? and how do i point my domain to my 8080 port? (using apache)
You need to use host headers to prevent conflicts if you're sharing the same IP, else you need your own IP. With the appropriate dns settings, and host headers setup in iis, you'll never conflict with his sites (that should also be using host headers).

Resources