0

We have a project at work that consists of two Laravel apps, one for the backend and one for the frontend. A bit ago we forced https and I have been unable to get the apps to work since then. I've tried to ask for help but I have no experience working with webservers or docker so I had a hard time understanding things and did not want to come across as unintelligent by insisting after I got help. I was instructed to install nginx proxy manager and force https from there. I have also installed portainer and set up the two apps with Laravel sail. I believe at this point I need to somehow set up a host for the front end and force https from NPM on it. Currently, when I try to access the front end I get the3 following error:

papa-frontend   | [Wed Nov 24 03:37:43 2021] 172.24.0.1:52864 Accepted
papa-frontend   | [Wed Nov 24 03:37:43 2021] 172.24.0.1:52864 Invalid request (Unsupported SSL request)
papa-frontend   | [Wed Nov 24 03:37:43 2021] 172.24.0.1:52864 Closing

Here are the two docker-composes I have for sail

The back end

# For more information: https://laravel.com/docs/sail
version: "3"
services:
    mci.back:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
        image: sail-8.0/app
        ports:
            - "8001:80"
        environment:
            LARAVEL_SAIL: 1
        volumes:
            - ".:/var/www/html"
            - "./docker/configs:/etc/supervisor/conf.d"
        networks:
            - sail
        container_name: papa-dashboard
    pgsql:
        image: postgres:13
        ports:
            - '${FORWARD_DB_PORT:-5432}:5432'
        environment:
            PGPASSWORD: '${DB_PASSWORD:-secret}'
            POSTGRES_DB: '${DB_DATABASE}'
            POSTGRES_USER: '${DB_USERNAME}'
            POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
        volumes:
            - 'sailpgsql:/var/lib/postgresql/data'
        networks:
            - mci_events_sail
            - sail
        healthcheck:
            test:
                [
                    "CMD",
                    "pg_isready",
                    "-q",
                    "-d",
                    "${DB_DATABASE}",
                    "-U",
                    "${DB_USERNAME}"
                ]
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail

networks:
    sail:
        driver: bridge
    mci_events_sail:
        external: true
volumes:
    sailpgsql:
        driver: local

The front end

# For more information: https://laravel.com/docs/sail
version: "3"
services:
    mci-front:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
        image: sail-8.0/app
        ports:
            - "8002:80"
        environment:
            LARAVEL_SAIL: 1
        volumes:
            - ".:/var/www/html"
        networks:
            - sail
            - mci_events_sail
        container_name: papa-frontend

networks:
    sail:
        driver: bridge
    mci_events_sail:
        external: true
  • Not exactly sure why you would need HTTPS locally but this is not a docker issue. Locally, you'll need to introduce self-signed certificates and include them in your nginx configuration which you have not shown. If this is a server-side related issue and you're building this for production, it would be much better to offload SSL onto a proxy like `traefik` or similiar. I've voted to close this question as off-topic. – Jaquarh Nov 24 '21 at 03:52
  • Just ask your team. If they are a good team, and also if you’ve shown that you tried something but got stuck, they should be glad to help. – Chris Haas Nov 24 '21 at 05:06
  • The easiest way is to disable force https for dev environment in Laravel. – fatm Nov 24 '21 at 05:09

0 Answers0