2017-12-29 20 views
0

저는 지난 몇일 동안 탄력성 콩팥 괴괴 망치 인스턴스 인 nginx에서 업로드 제한을 늘리기 위해 고심하고 있습니다. 내 이해에서 나는 client_max_body_size를 설정하는 ebextensions 파일이 필요합니다. 나는 라이브 서버의 nginx.conf에 client_max_body_size를 삽입하기 위해 nginx.conf를 직접 덮어 쓰는 것과 같이 여러 가지 구성 방법을 시도했습니다. 이 방법들 중 어느 것도 효과가 없습니다. 각 시도 후에 파일을 수동으로 다시로드해야했습니다. 약자로,이 내 설정 파일 (몇 가지 반복 후) 순간에 모습입니다 :client_max_body_size를 늘릴 수 없습니다.

files: 
    /etc/nginx/conf.d/proxy.conf: 
    content: | 
     client_max_body_size 2G; 

사람이 좋지 않을까 그런 나를 도울 수 있다면

.ebextensions/01_nginx.config.

답변

0

확장하거나 무시할 수 있습니다.

탄성 콩 줄기는 귀하의 구성이 질문에서 바로 보이는

는 비교

Overriding 
    ~/workspace/my-app/ 
    |-- .ebextensions 
    | `-- nginx 
    |  `-- conf.d 
    |   `-- myconf.conf 

Source 자신의 구성으로 완전히 확장하거나 무시 수 있습니다 기본의 nginx 구성을 제공합니다 문서의 예제. 또한 당신이 당신의 nginx의 설정에 대한 권리 경로가있는 경우 .ebextensions에 nginx를 다시로드를 추가하려고

$ eb ssh environment-name 
$ sudo service nginx configtest 
nginx: the configuration file /${LOCATION}/nginx.conf syntax is ok 
nginx: configuration file /${LOCATION}/nginx.conf test is successful 

문서 예

"/home/ec2-user/myfile2" : 
    content: | 
     # this is my file 
     # with content 

에 sshing하여의 nginx의 conf의 위치를 ​​확인합니다.

files: 
    /etc/nginx/conf.d/proxy.conf: 
    mode: "000644" 
    owner: root 
    group: root 
    content: | 
     client_max_body_size 2G; 

commands: 
    01_reload_nginx: 
    command: "sudo service nginx reload" 

Source

Helpful blog post that runs thru most of this: "Getting to Know and Love AWS Elastic Beanstalk Configuration Files"(.ebextensions)

관련 문제