How can I reconfigure CodeIgniter (v4) to serve with a new sub-directory path (via nginx)?

19 Views Asked by At

I have two applications (let's call them DRUPAL and CODEIGNITER (v4)) running in Elastic Beanstalk, each with a dedicated load balancer. I'd like to setup AWS CloudFront to consolidate the domains so they're both being accessed via the DRUPAL domain and use a PATH in the DRUPAL domain to send traffic to the CODEIGNITER app.

So it's currently setup with DRUPAL traffic going to https://DRUPAL.com and the CODEIGNITER traffic going to https://CODEIGNITER.com and I'd like it to consolidate it so that https://DRUPAL.com/PATH goes to the CODEIGNITER app.

So I have reconfigured CODEIGNITER's baseurl to https://DRUPAL.com/PATH so all of its links are correct. I have setup the CloudFront distribution with the two origins and the PATH behavior and that is sending traffic to the right places.

Where I'm getting hung up is that the CODEIGNITER app is getting called with the /PATH prefix and its routing isn't working for its controller runmodes as well as the static files (css, js, etc) that are in its public directory.

The Elastic Beanstalk is setup with nginx. I think what I'm looking for is a way to have it ignore the /PATH prefix when responding to requests and be able to serve dynamic and static content, just like it currently does via it's original domain.

I have tried various location configuration hacks, a symlink in the public folder, and redirects, but haven't found something that addresses every scenario (does the "homepage" work? does a child page work? does a static file work?).

0

There are 0 best solutions below