Skip to content

Instantly share code, notes, and snippets.

@inso
inso / Nginx redirect to named location
Last active May 18, 2020 — forked from ilguzin/nginx_redirect_2named_location
NGINX: Redirect from current location into named location
View Nginx redirect to named location
# Solution 1
# Use only codes greater than 418, do not use common status codes 404, 402, 403, etc
location /location1 {
error_page 463 = @app; return 463;
}
# Solution 2 (drawbacks unknown)
location /location2 {
try_files /dev/null @app;
}
You can’t perform that action at this time.