
记录一次NGINX的错误
问题复现 在网络中,发现css和js都正常加载了,但是在实际加载的网页中,只有front正常加载,css和js 大概就是这种效果(悲 我的nginx配置文件如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ```bash user nginx; worker_processes auto; error_log /folder/log/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http{ server { listen 80; server_name test.example,com; location / { root /folder/nginx/html/dist; index index.html index.htm; } 寻求方法 权限问题? 一开始以为是静态文件static的权限问题,就在static文件夹下执行了chmod -R 775 * 正则表达式映射? 1 2 3 4 location ~ ^/(?<dir>[^/]+)/(?<file>[^/]+)$ { gzip on; alias /folder/nginx/html/dist/static/$dir/$file; } SO上的一个回答,据说在加入这个后正则表达式就能匹配到静态文件...