How to set YOURLS_SITE HostIP/hostname for AWS?

I’m running a yourls instance as an AWS ECS Service and yourls requires to explictly set the environment variable -e YOURLS_SITE="your-domain.com" and if you don’t specify the YOURLS_SITE ,it redirects to
http://your-own-domain-here.com

Locally, I’m able to get it running on http://localhost:8080. If i keep it localhost:8080, the css breaks.
Is there a way you can get the YOURLS_SITE HOSTIP or hostname dynamically?

In AWS, I’m able to access the website over the Public IP of the ENI. But this Public IP is known only after I deploy to ECS. And it changes on every new service update. So how do I get yourls to dynamically set the YOURLS_SITE value?

Hello @masoom, thanks for this message!

YOURLS_SITE must contain the protocol http://.
Try -e YOURLS_SITE="http://your-domain.com".

Thanks for your reply @LeoColomb. I don’t have a domain at the moment registered in AWS Hosted Zones. I just would like to be able to test it using a Public IP. Is there a way you can disable that environment variable (from the config.php or index.php) and then it will just take the IP

Oh right.
Are you able to edit files in the container?

Yeah, I can. But it’s a bit hacky to ssh inside the container. If the container restarts, then the changes will be be persistent.

You are right, that’s why it is sometimes not even possible.
The AWS instance does not define an environment variable with the domain name?
Actually the argument regarding the persistance is not concrete since the IP is as volatile as the container, and you must define a domain name with an updated resolution for persistance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.