网站首页 > 技术教程 正文
1)空格,默认匹配,普通匹配
location / {
root D:\TRMS\project-jl\dist;
index index.html index.htm;
}2)精准匹配/home/zhoujin
location =/zhoujin {
root /home;
index index.html index.htm;
}3)匹配正则表达式,不区分大小写:~*
location ~ \.(gif|gpg|png|PNG){
root /home/zhoujin
}4)匹配正则表达式,区分大,小写:~
location ~* \.(gif|gpg|png|PNG){
root /home/zhoujin
}5)以某个字符路径开头^
location ^* \.(gif|gpg|png|PNG){
root /home/zhoujin
}Nginx跨域问题
www.baidu.com---->www.zhoujin.com请求数据
Cross_origin Resource sharing:跨域资源共享
解决方案:jsonp,Springboot Cors,Nginx
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';Nginx静态资源防盗链:只允许zhoujin.com域名的访问
#对源站点进行验证
valid_referes *.zhoujin.com;
if($invalid_referer){
return 404;
}
猜你喜欢
- 2024-10-10 Nginx web服务器(nginx Web服务器)
- 2024-10-10 Nginx 了解一下?(nginx的理解)
- 2024-10-10 Nginx可以做什么?看完这篇你就懂了
- 2024-10-10 Nginx常用配置(nginx配置cgi)
- 2024-10-10 Spring Boot 中的静态资源到底要放在哪里?
- 2024-10-10 「Web开发」Spring MVC 中的静态资源与缓存
- 2024-09-14 Openresty/Nginx 缓存设置(nginx 缓存配置)
- 2024-09-14 Nginx之6大千世界 - (FastCGI)(nginxgui)
- 2024-09-14 一篇文章了解nginx特性,值得收藏
- 2024-09-14 Nginx主要应用场景|反向代理|负载均衡|动静分离|HTTP服务器
欢迎 你 发表评论:
- 12-13电脑上不了网无internet访问
- 12-13怎么下载winrar解压缩软件(.rar怎么下载)
- 12-13设置路由器tplink(设置路由器怎么设置教程)
- 12-13360浏览器官网在线使用
- 12-13一键系统备份工具(一键系统备份软件)
- 12-132345浏览器影视大全(2345浏览器版本大全)
- 12-13office产品密钥在哪看(查看office产品密钥)
- 12-13电脑速度慢怎么清理(电脑很慢如何清理)
- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)

本文暂时没有评论,来添加一个吧(●'◡'●)