小编Dor*_*ore的帖子

如何使用 Nginx SSL 配置在上游运行 Gunicorn?

我有一个安装了 SSL 证书的 nginx 服务器。我想将上游的任何请求传递到运行在0.0.0.0:8000. 但是,每当我运行 Gunicorn 服务器时,它都会给我一个错误,指出重定向循环过多。如果我通过 https 运行 gunicorn,那么连接将变得安全,但它不会连接到 gunicorn 服务器,它只会说bad gateway. 此外,这是我在使用 https 运行 gunicorn 时尝试连接时遇到的错误:

Traceback (most recent call last):
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
    worker.init_process()
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
    self.run()
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 119, in run
    self.run_for_one(timeout)
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 66, in run_for_one
    self.accept(listener)
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 30, in accept
    self.handle(listener, client, addr)
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 141, in handle
    self.handle_error(req, client, addr, e)
  File "/opt/bitnami/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 213, in …
Run Code Online (Sandbox Code Playgroud)

ssl nginx gunicorn

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

gunicorn ×1

nginx ×1

ssl ×1