2016-10-03 2 views
2

AWS Elastic Beanstalk 및 gzip에 문제가 있습니다.탄성 콩 줄기로 nginx gzip을 사용할 수 없습니다.

저는 GZIP 압축, 특히 application/javascript의 gzip 압축을 사용하려고합니다. 그래서 저는 두 개의 개별 파일을 작성하려고했습니다.

00_elastic_beanstalk_proxy.conf이라는 첫 번째 파일과 /etc/nginx/conf.d 폴더에 있던 기존 파일의 내용을 복사하여 붙여 넣습니다. 내가 gzip.conf라는 또 다른 파일을 만든 다음

gzip on; gzip_comp_level 4; gzip_types text/html text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

와 나는이 코드를 넣어 : 파일의 끝에서

, 나는 다음 코드 줄을 추가 다른 하나 gzip.conf을 :

container_commands: enable_javascript_compress: command: sudo cp .ebextensions/00_elastic_beanstalk_proxy.conf /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf

나는 업로드하고 내가로 저장된 해당 파일을 배포하기 위해 노력하고있어 경우 10 폴더에서 gzip이 작동하지 않습니다.

ssh와 vim을 사용하여 서버에서이 파일을 편집하려고하면 모든 것이 잘 작동합니다.

문제를 해결할 수있는 방법이 있으며 매회 ssh를 연결할 필요가 없습니까?

답변

0

files 개체를 사용하여 gzip 파일을 만들어보세요. 다음은 nginx conf의 모습입니다.

files: 
    /tmp/install-nginx-conf.sh: 
    mode: "000755" 
    owner: root 
    group: root 
    content: | 
     #!/bin/sh 
     cp /tmp/nginx_proxy.conf 
/tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf 
관련 문제