skip to Main Content

I’m running Laravel with Octane with frankenPHP. It works fine but does not show images. I found that url() function in my views returns http://localhost:8002 which is docker address. I expect url() to return my domain name for example: http://example.com

In my docker-compose.yaml I have:

version: "3.9"
    services:
      app:
        image: "my_image:latest"
        entrypoint: php artisan octane:frankenphp
        restart: unless-stopped
        hostname: example.com
        ports:
          - "8002:8000"

My .env file:

APP_NAME=Laravel
APP_ENV=prod
APP_KEY=base64:api_key
APP_DEBUG=false
APP_URL=http://example.com

Does anyone know how to fix that?

2

Answers


  1. Chosen as BEST ANSWER

    The problem was that I hadn't set X-Forwarded-For in my NGINX. Now it works.


  2. You have to set APP_URL in your .env file

    Change APP_URL=http://localhost to this APP_URL=http://example.com

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search