2017-09-29 1 views
0

내 Elastic Beanstalk Flask 응용 프로그램에서 "403 Forbidden"오류를 해결하려고 노력 중입니다. 나는 다음과 같이 내 python.config 파일을 설정 한 :탄성 콩 줄기 정적 폴더 403 오류

option_settings: 
    aws:elasticbeanstalk:container:python:staticfiles: 
    "/static/": "/static/" 
    "/templates/": "/templates/" 


commands: 
    01_set_file_permissions: 
    command: "chmod 777 /opt/python/current/app/static/" 

정적 폴더는 처음에 제공 한 404 만 python.config의 정적 파일 섹션은 그 고정. 내 문제는 서버에서 파일 권한을 인식 할 수 없다는 것입니다. 항상 403 오류를 반환합니다. 도와주세요.

+0

템플릿과 관련이 없지만 템플릿 파일을 정적으로 제공하지 않는 경우 (실제 HTML이 아닌) 그물을 사용하는 사람이 템플릿을 사용할 수 있습니까? 그게 네가하고자 한 일인가 궁금하다. 그렇다면 왜? – vlsd

답변

0

해결 방법을 찾았습니다. path to folder가 상대 경로로 주어지지 않았기 때문에 option_settings 섹션이 잘못되었습니다. 또한/static/폴더는 AWS 콘솔의 하드 코딩 된 값을 통해 이미 설정되었습니다.

AWS> Elastic Beanstalk>> 구성> 소프트웨어 구성> 가상 경로./static/value를 static/here로 변경해야했습니다.

마지막으로 명령 섹션은 전혀 필요하지 않았습니다.

option_settings: 
    aws:elasticbeanstalk:container:python:staticfiles: 
    "/templates/": "templates/" 
관련 문제