lando / laravel

The Official Laravel Lando Plugin
https://docs.lando.dev/laravel/
GNU General Public License v3.0
15 stars 11 forks source link

Lando appserver redirects to https #31

Open divdax opened 1 year ago

divdax commented 1 year ago

Hey! 👋

I’m very new to Lando. Yesterday i tested Lando on a Laravel project and everything is working fine. Now i did a lando init on another project and copied my working .lando.yml from the first working project. After lando start my new project is up and all the domains are green. When i visit the site i get a permanent http -> https 301 redirect (too many redirects). Event when i accept the cert i just get a blank page with 404 page not found.

Also tried with this, but on start every url is red.

services:
  appserver:
    ssl: false

Any ideas?

.lando.yml

name: pronet
recipe: laravel
config:
  webroot: public
  php: '8.0'
  database: mysql
  cache: redis
  composer_version: 2
services:
  appserver:
    config:
      php: .lando/php.ini
    build_as_root:
      - apt update -y
      - curl -sL https://deb.nodesource.com/setup_19.x | bash -
      - apt install -y nodejs cron supervisor wkhtmltopdf
      - npm install -g nodemon
      - cp -f /app/.lando/docker-php-entrypoint.sh /usr/local/bin/docker-php-entrypoint
      - cp -f /app/.lando/horizon.conf /etc/supervisor/conf.d/horizon.conf
    run_as_root:
      - service cron start
      - service supervisor start
      - supervisorctl start horizon
      - nohup /usr/bin/nodemon --exec /usr/local/bin/php artisan horizon:terminate -e php
    run:
      - crontab /app/.lando/cron.txt
      - composer install
      - php artisan storage:link
  database:
    portforward: 3307
  mail:
    type: mailhog
    portforward: true
    hogfrom:
      - appserver
tooling:
  npm:
    service: appserver
proxy:
  mail:
    - mail.pronet.test 

php.ini

[PHP]

max_execution_time = 60
max_input_time = 900
max_input_vars = 10000
memory_limit = 1000M
upload_max_filesize = 100M
post_max_size = 100M

// Edit

docker ps All containers are up:

CONTAINER ID   IMAGE                                COMMAND                  CREATED         STATUS         PORTS                                                                     NAMES
c9a55287aca1   bitnami/mysql:5.7.29-debian-10-r51   "/lando-entrypoint.s…"   3 minutes ago   Up 2 minutes   127.0.0.1:3307->3306/tcp                                                  pro_database_1
d63119c82219   redis:5                              "/lando-entrypoint.s…"   3 minutes ago   Up 2 minutes   127.0.0.1:51736->6379/tcp                                                 pro_cache_1
099b0f56bd26   mailhog/mailhog:v1.0.1               "/lando-entrypoint.s…"   3 minutes ago   Up 2 minutes   8025/tcp, 127.0.0.1:51738->80/tcp, 127.0.0.1:51737->1025/tcp              pro_mail_1
cd3c02f40039   devwithlando/php:8.0-apache-4        "/lando-entrypoint.s…"   3 minutes ago   Up 2 minutes   127.0.0.1:51739->80/tcp                                                   pro_appserver_1
b2d7190f9caa   traefik:2.2.0                        "/lando-entrypoint.s…"   4 minutes ago   Up 3 minutes   127.0.0.1:80->80/tcp, 127.0.0.1:443->443/tcp, 127.0.0.1:51673->8080/tcp   landoproxyhyperion5000gandalfedition_proxy_1

I also tried to use another name and did a lando poweroff & lando rebuild Visiting the mail URL is working. Just my main app domain is redirected to https all the time. My app itself doesn't redirect insecure requests to https.