Website refuses to open on custom domain but works on IP - django

I am trying to bring my Django website online with a custom domain.
The website is melius.live and the IP of the webserver is 157.90.29.120. However, opening the IP works fine, opening the domain usually doesn't work, sometimes it gives me an Apache default page (I am using NGINX, not Apache), but normally just a connection refused.
The site is written in Django, I am using Hetzner for hosting and Namecheap for the domain.
When I do a traceroute, the correct IP shows up.
Where is the problem?

Related

Chrome err_connection_reset on lte connection

So I have a very weird problem, I have a website and when I'm connected through wifi everything is fine, chrome and Mozilla are loading my website.
But when I switch to LTE internet my website is working fine only on Mozilla. Chrome is throwing ERR_CONNECTION_RESET error. I tried turning off firewall and restarting the server, but it doesn't change anything. The website was made in Django.
On the other hand, when I'm connecting directly to IP, it's working (I see 404 from apache, but that's because it's configurated to work with domain).
I'm using also certbot, but it's not looking like certbot fault. It's rather something connected with domain configuration.
I'm using OVH services both for server and domain. In domain I added only ip4 and ip6, DNS servers were left in the default configuration.
Ok, so to fix it I removed IPv6 redirect from the domain. And now it's working. I hope that it will help someone :)

problems connecting with the server of my website

I have a website and until some time ago it was administrated by a friend of mine; recently our relationships have been reduced, so I took the entire control of the website.
I'm not really expert with some aspects in the management of a web site. Actually I would make some back-end edits and I should connect with the server of the website.
I have the host IP, a username and a password. I tried to connect using Filezilla but I receive an error message: 530 Login incorrect.
So, I contacted the domain provider, I was convinced that the domain provider was the same of the hosting provider, but they told me that it was not true and that the hosting for the website is provided by "someone else" (it could be an other hosting provider or a private web-server, for example).
I don't know what to do.
How can I connect to the server of my website? What am I missing?
p.s.: sorry for my bad english
I think you might be pointing filezilla at port 80. Try pointing at the ftp port (21 probably.) If this doesn't work it could be that the hosting uses a non standard port.
If in doubt get some support from the hosting company. Only they know how they are set up. If the use something like cpanel you can access files through that. They may be reluctant to help if you can't prove the site is yours. Usually by using the email address you set up when you bought the hosting.
And no, the domain provider does not have to be the same as the hosting provider. My domains are hosted at godaddy and I have odd bits of hosting all over the place ;)

AWS Load Balancer https issue

I was trying to setup the load balancer for our servers. if use the http, it works fine. But when I switch to https, I got following errors in the browser console:
Mixed Content: The page at 'https://www.something.com/' was loaded over HTTPS, but requested an insecure script '...mootools.js'. This request has been blocked; the content must be served over HTTPS
I thought I did some hard code like "http://www.something.com/library/....",
but I did not, I only use the "/library/...." for including the javascript files.
When I set up the load balancer, it was asked me to setup the port for listening. I set as https , load balancer port: 443 forward to instance port 80.
Is anybody knew how could I solve this problem.
Thanks.
The forwarding back to 80 isn't responsible for it. This is either HTML that is hardcoded to http or a redirect/server-generated URL pointing to http.
Use the network panel of dev tools (like in Chrome's menu) and inspect each request until you find the culprit.
Here's an example, using this question page. I've selected an insecure request.

How do you change the DNS for a website hosted on an Azure Linux server VM?

I have a website running CMSMadeSimple on an Azure Linux VM. The current URL is [website].cloudapp.net/cmsmadesimple, but now that the site is complete I need to change the it to the client's URL [website].com.
I've done this in the past by simply remoting in to the server and changing the DNS records, but since the VM is Linux, I can't just remote it. I've looked around but have yet to find a solution.
What am I missing here?
Just create a CNAME or A record. However, your application server must cooperate by redirecting the request to your new hostname to the existing application. It's likely a VirtualHost is already setup for this but if you get a 404 then you need to "remote" in.
First update the config.php files for the new domain.
Second update your vhost files on your webserver to listen to the new domain.
Final update the DNS (usually it is where you registered the domain -- like godaddy.com, namecheap.com, etc) to point to the IP or alias given to you by Azure.

Django: external access

I have been setting up a Django website using the development server, and it works fine if I access it using the following address in my browser:
localhost:8000
I now want to be able to access the website from another computer (on the same network). I still want to use the development server for now. If my computer's name on the network is myname, and the domain is mydomain.com, then how can I enable this? If I just type in:
myname.mydomain.com:8000
I get a Server not found error.
Thanks.
It's not possible to access your computer like they way you explained in a LAN. There are couple of ways you can let other computers use your dev server directly.
First, run your Django app like this -
$ ./manage.py runserver 0.0.0.0:8000
So that the server listens to all the network interfaces for anyone accessing your IP, not just localhost. Then -
Find out your IP in the network. In the other computer in the same network open the hosts file(In linux, it's at /etc/hosts) and enter a new line -
enter.your.ip.here intended.domainname.com
Then you can access your dev server from that computer by entering intended.domainname.com:8000 or enter.your.ip.here:8000 in the browser. Cons: You have to alter the hosts file in each of the computer you intend to use the domain name instead of IP from and they all have to be in the same network.
You could use localtunnel. Then you can just execute -
$ localtunnel 8000
And it'll give you an url like http://xyz.localtunnel.com which you can share to anybody using the Internet and they'll be able to use your dev server.