我已经配置了 nginx 别名,预期的行为是每当有https://demo-frontend.in/dl/uurl/orr时,它应该从 /var/www/frontend_react/build/ 目录获得请求。但相反,它是从默认的 /var/www/frontend/public 目录中获取的。
server {
listen 80;
root /var/www/frontend/public;
index index.php index.html index.htm;
server_name demo-frontend.in;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /dl {
alias /var/www/frontend_react/build/;
try_files $uri $uri/ /index.html?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}