Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX Using multiple php-fpm containers #5

Open
Xilonz opened this issue Mar 22, 2021 · 3 comments
Open

NGINX Using multiple php-fpm containers #5

Xilonz opened this issue Mar 22, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Xilonz
Copy link

Xilonz commented Mar 22, 2021

I'm trying to create a setup where we can quickly check if our plugin is working in \w multiple PHP versions.

NGINX is cycling through the available PHP services, no matter what NGINX service you are visiting. On each visit, the next service will be used.

The cause of this issue is the static network name that is used for the php-fpm service (defined here). All the services will get the same network alias, so NGINX doesn't have a clue which PHP service belongs to him.

recipe: wordpress
name: myphpproject
config:
  php: '7.4'
  config:
    vhosts: .lando/default.conf.tpl
proxy:
  appserver_nginx:
    - myphpproject.lndo.site
  php80_nginx:
    - 80-myphpproject.lndo.site
  php56_nginx:
    - 56-myphpproject.lndo.site
services:
  php80:
    type: php:8.0
    via: nginx
    webroot: .
  php56:
    type: php:5.6
    via: nginx
    webroot: .

/w overrides it would (probably, untested) look like this:

  php56:
    type: php:5.6
    via: nginx
    config:
       vhosts: .lando/56-default.conf.tpl #we need to change file so we can change the upsteam php
    overrides:
      networks:
        default:
          aliases: 
            - fpm3

Ideally, we would be able to attach multiple PHP services to one NGINX service. I've tried setting the via to cli and image to fpm so no additional NGINX service will be created and used the overrides mentioned above. This seems to work, however, I haven't figured out the correct NGINX config yet.

Any other suggestions for quickly switching between PHP versions are also welcome. NGINX is required.

@Xilonz Xilonz added the bug Something isn't working label Mar 22, 2021
@pirog pirog self-assigned this Mar 23, 2021
@stale
Copy link

stale bot commented Oct 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

@Xilonz
Copy link
Author

Xilonz commented Apr 13, 2022

unstale - issue is still relevant :)

@pirog pirog added the nginx label Apr 19, 2022
@rtfm-47 rtfm-47 added Needs Triage and removed bug Something isn't working nginx labels Apr 19, 2022
@rtfm-47 rtfm-47 transferred this issue from lando/lando Apr 19, 2022
@pirog pirog added bug Something isn't working and removed Needs Triage labels Apr 19, 2022
@pirog
Copy link
Member

pirog commented Apr 19, 2022

@Xilonz i moved this over to the right issue queue. @labboy0276 this might be an easy one to take care of. I think all we have to do is make the alias a bit more dynamic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants