Why my new server shows numbers in the URL address? - amazon-web-services

I had to create a new AWS Server because the current server will be disabled, and I'm having some trouble about the domain/subdomain.
The current server has this domain: http://agile.tecomat.com.br
I already created a new server and inserted a subdomain, called: http://teste.tecomat.com.br
But, in the URL address, the current server shows this:
And the new server, shows this in the URL address:
What do I need to do so that the new server be like the current one in the URL address?
Edit: By the way, another problem that I'm having is that my DNS only works if I insert the port 3000. Like: http://54.89.39.213:3000
If I tried to open the website only with http://54.89.39.213, it doesn't work, anyone knows why is that? And what I have to do to "fix" that?

Related

How to display a visitor's IP address by ipware app?

I want to get the user's IP address when he visits my site, I found many solutions but I picked one of them which is: ipware application that I installed it but when I used it the result returned: 127.0.0.1 which is localhost not the IP of my device
my experience using IP is weak but I understand a little bit why it returned that result I think that because I'm on the localhost so, it uses a private IP as I thought so if that answer is correct How could I try to print the user's IP of the anonymous user before I upload the website on production to show the expected result and sure that everything's ok now?
from ipware import get_client_ip
print(get_client_ip(request))

Not able to make ajax request when uses IP address instead of localhost

I developed Django based web application in my company which I was able to access at localhost:
http://127.0.0.1:8000/olx
and made the ajax request without fail. When I accessed the same on my computer's IP address:
http://10.0.100.148:8000/olx
, all things were working except ajax reuquest. I got the following error message:
403 forbidden
Later I did the same thing in my personal laptop at my home and saw that I was able to access ajax request as well in both the cases: localhost and my laptop's IP address:
http://192.168.1.8:8000/olx
, which was connected to a wifi network. I also accessed the application in my mobile,connected to the same wifi-network, by typing the laptop's IP address and it was working fine.
Now I am in confusion that why I was not able to make the ajax request at the IP address of my company's computer.
What went wrong.
Can somebody help me to understand the reason behind this?
Did you check django logs, anything more than a 403? Could it be an authentication issue?
If you happen to have DEBUG = False then make sure the ALLOWED_HOSTS variable in settings has all the IP-s you listed.

How do I stop re-directs to another website?

I created my own local website(to run in my localhost) called http://testrb.com. But when I key that in a browser, it is redirecting to someone else's https://www.testrb.com. I want to prevent this and view my testrb.com. How do I do this? I am using apache webserver
I think the problem cames from the browser: since third level domain "www." browsers now a days are trying to add that domain to the URL. To solve that try to type all the address adding also http://.
If still not working you should try to use a local DNS: add the alias in your /etc/resolv.conf to the line starting with 127.0.0.1 appending the domain name testrb.com separated with a space(in UNIX systems).

AWS, Recover from IP address change

I want to recover from IP address change. My website used to be running fine, but after I allocated elastic IP address, it stopped working I want the website to be running again with new IP address.
So my question is: What steps must I consider and where should I look at first to recover from IP address change?
I can't access that website with old DNS address or new DNS address. Is this DNS issue?
Notes that might be helpful:
My web server seems to be using nginx, and I tried changing the configuration file with new dns, but that doesn't seem to do it.
When I access new domain name, it redirects to old domain name.
when I check with curl using curl -I http://localhost:80, it says HTTP/1.1 301 Moved Permanently
Just as an add on. The problem is this configuration change in your nginx file:
server {
listen 80;
server_name my.old.domain.com;
...
}
Has to be changed to:
server {
listen 80;
server_name my.new.domain.com;
...
}
So the DNS change can take up to 48 hours to propagate (it usually takes 10-30 minutes from experience, depending on your DNS provider)
When the DNS server wasn't propagated nginx would still redirect you to my.old.domain.com
Hope this helps.
Okay, I think it was just time issue.
After changing web server configuration (nginx), I waited around 28 hours and it suddenly started working again.
Source:
Subdomain IP address changed but client still getting directed to old site

Connecting a DD-WRT router to a Squid proxy running on AWS

I am trying to get a Linksys router with the latest DD-WRT (v24-sp2) in my house connected, via Comcast, to an external Squid (v3) proxy that I am running on AWS. When I connect over the WiFi to the DD-WRT router, it connects to the Squid proxy, but I get the nasty message (abbreviated here to show relevant part):
While trying to retrieve the URL: /
Note the backlash. I get this when I go to a root domain, like www.cnn.com. If I go to a page under a site, like www.cnn.com/today (fake link used for example only), that returns and error like:
While trying to retrieve the URL: /today
Again, notice the "/today", as if the root domain has been removed, and the string to the right of the domain name is being searched on.
For some background, I have installed Squid as generally as possible, and have done it on two servers with the same results. I get this same error no matter what domain I go to. Also, if I switch my network on my Mac to use this Squid proxy, it works fine. Only the connections from the DD-WRT give this error.
I have tried the instructions on the DD-WRT site with no luck. Others seem to have gotten this working well, so I assume I am making a configuration mistake.
Any clues for me? TIA...