静态资源访问配置
windows下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| server { keepalive_requests 120; listen 9090; server_name 127.0.0.1; location ~*^.+$ { proxy_pass http://mysvr; deny 127.0.0.1; allow 172.18.5.54; index index.php index.html; rewrite /index.html /index.php permanent; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } location ~ \.(js|css|jpg|png) { expires 1h; valid_referers shop.devops.com; if ($invalid_referer) { return 404; } } } server { listen 9091; server_name localhost; location /image { root D:\apache-tomcat-10.0.23\webapps\patrol ; } }
|
请求url:http://localhost:9090/image/a.jpg
实际请求地址:D:\apache-tomcat-10.0.23\webapps\patrol\image\a.jpg