我已经使用 uWSGI 部署了 WSGI 应用程序,但是我没有使用 NGINX https://serverfault.com/a/590833/96915。我该如何使用uWSGI的内部路由 http://uwsgi-docs.readthedocs.org/en/latest/InternalRouting.html重定向http
要求https
?
我努力了uwsgi --route-uri="^http:\/\/(.+)$ redirect-permanent:https://\$1"
但从 uWSGI 收到错误:unrecognized option '--route-uri=^https:\/\/(.+)$ redirect-permanent:https://\$1'
要将 http 重定向到 https,请使用以下配置:
[uwsgi]
; privileged port can only be opened as shared socket
shared-socket = 0.0.0.0:80
shared-socket = 0.0.0.0:443
;enable redirect to https
http-to-https = =0
; enable https, spdy is optional
https2 = addr==1,cert=server.crt,key=server.key,spdy=1
; alternative
; https = =1,server.crt,server.key
; force change of user after binding to ports as root
uid = user
gid = usergroup
; where original app will be running on IP or UNIX socket
socket = 127.0.0.1:8001
module = smthg.wsgi
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)