简体   繁体   English

AWS Elastic Beanstalk在URL中插入文件夹

[英]AWS Elastic Beanstalk inserts folder in url

I have a usual php/angular.js project, where my index.php file is in root / and the other files are in folders like /css or /bower-components and so on. 我有一个通常的php / angular.js项目,其中index.php文件位于root /下,其他文件位于/ css或/ bower-components等文件夹中。

When I zip this and upload it to Elastic Beanstalk, I get a strange problem: AWS finds my index.php file, but for all other files like .js and .css Elastic Beanstalk inserts an extra folder in the url. 将其压缩并上传到Elastic Beanstalk时,遇到一个奇怪的问题:AWS找到了我的index.php文件,但是对于所有其他文件(如.js和.css),Elastic Beanstalk会在url中插入一个额外的文件夹。 I have absolutely no idea why. 我完全不知道为什么。

Chances are this is due to how you are zipping up your code. 可能是由于您压缩代码的方式所致。 But if you want to fix this without changing your zip all you need to do is tell Beanstalk what your "document root" is. 但是,如果您想在不更改zip的情况下解决此问题,您所要做的就是告诉Beanstalk您的“文档根目录”是什么。

Using the Elastic Beanstalk web console: 使用Elastic Beanstalk Web控制台:

Click on environment -> Configuration -> Software Configuration (Gear icon) -> Document Root. First option on page.

Set to: projectname 设置为: projectname

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

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