I have an AWS Elastic Beanstalk application:
As you can see, I am running a Web Server on Tomcat.
After running Google PageSpeed Insights over my website , I see in order to improve performance I need to Enable compression .
I have read here that I need to add a .ebextensions
folder to my root folder. Where is that?
I have tried adding it to my webapp
folder. Is that correct?
What files do I need to add to this .ebextensions
folder? Then do I just upload the app to AWS via the dashboard?
Apologies for being vague, but as you can tell, I am pretty clueless here.
UPDATE
I added this to the root:
.../main/webapp/.ebextensions/apache.config
where apache.config
:
files:
"/etc/httpd/conf.d/gzip.conf":
mode: "000644"
owner: root
group: root
content: |
<Location />
# Insert filter!!!
SetOutputFilter DEFLATE
</Location>
However, when I test it here , I get:
The root folder is jbosswildfly
in the above case. It shouldn't be added to webapps
.
Putting Cloudfront in front of your EB instance is also an option.
There is a checkbox in the behavior settings "Compress Objects Automatically" to enable gzip compression.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.