Я запрашиваю страницу индекса, сервер определяет, вошел ли клиент в систему. Если нет, перенаправляет на страницу входа (я хочу это mydomain/login
). Но я получаю перенаправление localhost\login
Я смотрю документ caddy
, но не могу найти разрешение, или мне его не хватает
часть кода Python
@app.route('/')
def index():
if session.get('username'):
return render_template('index.html')
else:
return redirect(url_for('login'))
Конфигурация моего кэдди
domain {
tls myemail
gzip
timeouts none
proxy / localhost:5000
}
скручиваемость
# curl -i https://mydomain
HTTP/2 302
content-type: text/html; charset=utf-8
date: Tue, 21 May 2019 14:11:54 GMT
location: http://localhost:5000/login
server: Caddy
server: Werkzeug/0.15.2 Python/3.6.7
content-length: 217
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/login">/login</a>. If not click the link.