给定以下虚拟主机:
<VirtualHost *:80>
DocumentRoot "/var/www/dashboards/public/dist"
Servername local.dashboards
ServerAlias local.dashboards
Header add Access-Control-Allow-Origin: "*"
Header add Access-Control-Allow-Methods: "POST, GET, OPTIONS, PUT, DELETE, HEAD"
Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept, Authorization"
Alias /api /var/www/dashboards/laravel/public
<Directory "/var/www/dashboards/public/dist">
Options MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/dashboards/laravel/public">
Options MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Location />
ProxyPass http://localhost:3030/
ProxyPassReverse http://localhost:3030/
</Location>
ErrorLog ${APACHE_LOG_DIR}/dashboards.error.log
CustomLog ${APACHE_LOG_DIR}/dashboards.access.log combined
</VirtualHost>
ahone 可以建议为什么对 local.dashboards/api 的请求仍然被 Location 指令捕获吗?我可以确认节点服务器正在捕获对 /api 的请求并返回 404 页面。
从文档:
A
<Location />
几乎适用于一切。怎么样
<LocationMatch !^/api>
呢?