问题原文
原帖链接 · mleaf · CC BY-SA 4.0
I have a location block in my nginx server, if i access using https://example.com/login/ display my alias folder value correctly, but if i use as follow: https://example.com/login/?param1=value1, i have a Error 400 bad request
location ~ /login/ {
alias /var/www/app_one/dist/;
try_files $uri$args $uri$args/ /var/www/app_one/dist/index.html;
}
已采纳解答
原帖链接 · Tero Kilkanen · CC BY-SA 4.0
try_files is used to refer to physical files on the filesystem. With your configuration, when requesting /login/?param1=value1, nginx tries to find file /var/www/app_one/dist/login/param1=value1.
Depending on the actual contents of param1 and value1, nginx might respond with 400 Bad request, because some characters are not allowed when accessing files.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
