ChristophAust's avatar

Pagination and AWS application load balancer

Hi guys,

so I have an application routed through cloudflare, an application load balancer to an EC2. The pagination renders to URLs using its IP address, while other links are perfectly fine.

Any ideas how to fix that?

I tried to expose config/trustedproxies.php and I have put this in my applicationprovider:

        if (config('app.env') != 'local') {
            $this->app['request']->server->set('HTTPS', 'on');
        }
        if (config('app.env') != 'local') {
            $url->forceScheme('https');
        }
0 likes
1 reply
ChristophAust's avatar
ChristophAust
OP
Best Answer
Level 5

In case anyone stumbles upon the same thing. I deployed Laravel via Elastic Beanstalk on an EC2 instance.

Elastic Beanstalk does healthchecks on the root (can be configured). So I have a collection on the root page which I cache to reduce DB load. If after invalidation of the cache the first call was which healthcheck, the collection got cached with the local IP of the machine, since this was a local check.

I fixed that by changing the healthcheck to another route .

Please or to participate in this conversation.