Route defaulting to localhost after passing through SQS queue to ElasticBeanstalk Worker

Posted 9 months ago by s1rc

I have a primary web/api Laravel app and a worker Laravel app both running on AWS ElasticBeanstalk. The web/api app is public facing, the worker is not. Both apps have a shared common package, in which the notifications, models, etc. are stored.

Sending mail notifications from the web app to SQS, the worker picks them up and sends them correctly. However the routes in the notifications are not returning the domain of the web app, but instead https://localhost/.

I've checked on the worker, the APP_URL is configured properly (php artisan route:list shows them). Even using tinker config('app.url'); returns the correct URL on the worker.

I know the routes are working, because the models passed to the route() are being resolved to their IDs correctly.

Please sign in or create an account to participate in this conversation.