Skip to content

Instantly share code, notes, and snippets.

@daimon99
Last active September 5, 2019 04:49
Show Gist options
  • Save daimon99/77a7437abd16f3b023885955cd4950d9 to your computer and use it in GitHub Desktop.
Save daimon99/77a7437abd16f3b023885955cd4950d9 to your computer and use it in GitHub Desktop.
django首页重定向
location = / {
try_files /index.html @django;
}
location @django {
proxy_pass http://127.0.0.1:9076;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Cache-Control no-store;
}
path('', lambda request: redirect('admin:essaygo_article_add', permanent=False)),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment