|
|
@ -0,0 +1,17 @@ |
|
|
|
error_page 419 = @redirectoToSlash; |
|
|
|
set $is_admin_area "0"; |
|
|
|
if ( $request_uri ~* ^/admin.*$ ) { |
|
|
|
set $is_admin_area "${is_admin_area}1"; |
|
|
|
} |
|
|
|
if ( $request_uri ~* ^.*ajax.*$ ) { |
|
|
|
set $is_admin_area "${is_admin_area}1"; |
|
|
|
} |
|
|
|
if ( $request_uri ~* ^[^\?\.]*[^/](|\?.*)$) { |
|
|
|
set $is_admin_area "${is_admin_area}0"; |
|
|
|
} |
|
|
|
if ( $is_admin_area = "00" ) { |
|
|
|
return 419; |
|
|
|
} |
|
|
|
location @redirectoToSlash { |
|
|
|
rewrite ^(.*[^/])$ $1/ permanent; |
|
|
|
} |