본문 바로가기
파이썬

파이썬 Gunicorn을 포트 80에서 실행하기

by º기록 2021. 1. 19.
반응형

플라스크로 API를 구축했습니다. 내 앱에는 정적 자산이 없으므로 nginx를 사용할 이유가 없습니다.

포트 80에서 gunicorn을 실행하고 싶습니다.

"배포 스크립트"가 있습니다.

mkdir .log 2> /dev/null
DEBUG=0 gunicorn -b 0.0.0.0:80 backend:app --access-logfile .log/access.log --error-logfile .log/general.log


authbind python -m SimpleHTTPServer 80 을 실행할 수 있습니다.

authbind ./deployment.run 80 을 실행하려고하면

다음 오류가 표시됩니다.

2013-04-25 15:32:55 [24006] [ERROR] Can't connect to ('0.0.0.0', 80)
2013-04-25 15:33:08 [24018] [INFO] Starting gunicorn 0.17.4
2013-04-25 15:33:08 [24018] [ERROR] Retrying in 1 second.
2013-04-25 15:33:09 [24018] [ERROR] Retrying in 1 second.
2013-04-25 15:33:10 [24018] [ERROR] Retrying in 1 second.
2013-04-25 15:33:11 [24018] [ERROR] Retrying in 1 second.
2013-04-25 15:33:12 [24018] [ERROR] Retrying in 1 second.

gunicorn을 포트 80에 바인딩 할 수없는 이유는 무엇입니까?

권장 사항이 있습니까?

 

해결 방법

 

배포 스크립트에 authbind를 넣으십시오.

mkdir .log 2> /dev/null
DEBUG=0 authbind gunicorn -b 0.0.0.0:80 backend:app --access-logfile .log/access.log --error-logfile .log/general.log

그런 다음 ./ deployment.run 80 을 실행하십시오.

(또한 스크립트가 매개 변수를 사용하지 않는 것 같습니다. 스크립트의 80 $ 1 로 바꾸시겠습니까?)

 

참조 페이지 https://stackoverflow.com/questions/16225872

 

 

반응형

댓글