I’m new at digitalocean, trying to deploy my aiohttp app. I have got a domain name and it’s already set in digitalocean dns records.
So, in my backend I have a route "/persons", it’s available to get it if I go "{row_ip}/persons", but if ill try to get it with domain name "{domain_name}/persons" it will always redirect me to "/" page ( and also make "/" request from backend). Any suggestions how to make available to get "{domain_name}/persons" with domain name? Thanks for your time.
2
Answers
The following works for me:
I created a basic Golang web server:
Build it:
Create Droplet and grab its IP:
Update DNS:
Copy the binary:
SSH in and start the server:
Then test it:
You can achieve this with a rewrite in an htaccess file in your website’s directory.
You will want to create an .htaccess file in that directory with the following (replacing the IP and domain with your own):