简体   繁体   English

AWS Elastic Beanstalk Nginx 虚拟主机

[英]AWS Elastic Beanstalk Nginx Virtual Hosts

I have started to test a migration from PHP 7.0 to 7.4 on AWS Elastic Beanstalk.我已经开始在 AWS Elastic Beanstalk 上测试从 PHP 7.0 到 7.4 的迁移。 Worked out some issues with yum package names.解决了 yum package 名称的一些问题。 But im having an issue with my old virtual hosts situation.但是我对我的旧虚拟主机情况有疑问。

Previously this was in a.conf file in.ebextensions:以前这是在.ebextensions 中的.conf 文件中:

files:
  "/etc/httpd/conf.d/vhost.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
      NameVirtualHost *:80
      NameVirtualHost *:443

      <VirtualHost *:80>
        ServerName dashboard.domain.com
        ServerAlias www.dashboard.domain.com
        DocumentRoot /var/www/html/
      </VirtualHost>
      <VirtualHost *:443>
        ServerName dashboard.domain.com
        ServerAlias www.dashboard.domain.com
        DocumentRoot /var/www/html/
      </VirtualHost>
      <VirtualHost *:80>
        ServerName txtlocal.domain.com
        ServerAlias www.txtlocal.domain.com
        DocumentRoot /var/www/html/includes/txtlocal_inbound/
      </VirtualHost>
      <VirtualHost *:443>
        ServerName txtlocal.domain.com
        ServerAlias www.txtlocal.domain.com
        DocumentRoot /var/www/html/includes/txtlocal_inbound/
      </VirtualHost>

Now im having issues getting those virtual hosts to work.现在我在让这些虚拟主机工作时遇到问题。 What do I need to change for PHP 7.4 to work with my virtual hosts?我需要更改哪些 PHP 7.4 才能与我的虚拟主机一起使用? I can see that the server changed to nginx, is there a way to do it in a nginx config file?我可以看到服务器更改为 nginx,有没有办法在 nginx 配置文件中做到这一点? I can't seem to find anything in the docs for AWS Elastic Beanstalk...我似乎在 AWS Elastic Beanstalk 的文档中找不到任何内容......

Yo are trying to use virtual hosts instead of server/locations.哟正在尝试使用虚拟主机而不是服务器/位置。 AWS used Apache, but in modern versions they are deploying aplications with NGINX. AWS 使用了 Apache,但在现代版本中,他们正在使用 NGINX 部署应用程序。 I'm facing the same upgrade situation.我面临着同样的升级情况。

Read this if you want to understand how to define "virtual servers" in NGINX: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04如果您想了解如何在 NGINX 中定义“虚拟服务器”,请阅读本文: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on -ubuntu-16-04

This may also help: https://www.keycdn.com/support/nginx-virtual-host这也可能有帮助: https://www.keycdn.com/support/nginx-virtual-host

You can find NGINX conf file using您可以使用找到 NGINX conf 文件

nginx -V

Note mayus V注意马尤斯 V

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM