跨域 · 后台设置:头部header自定义属性

(服务器端添加属性、属性值,浏览器端获取属性及其值)

headers 服务端配置


# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/user              nginx;
worker_processes  4;error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;pid        /var/run/nginx.pid;events {worker_connections  1024;
}http {include       /etc/nginx/mime.types;default_type  application/octet-stream;log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log  /var/log/nginx/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  180;#gzip  on;server {listen       80;server_name  www.1688jobs.com;#charset koi8-r;#access_log  logs/host.access.log  main;location ~ .php$ {root /usr/share/nginx/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}location ^~/images/ {root /var/lib/tomcat6/webapps/;}location  ^~/jobs-api/ {proxy_pass http://127.0.0.1:8080/jobs-api/;proxy_redirect off;   proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;if ($request_method = 'OPTIONS') {add_header 'Access-Control-Allow-Origin' '*';add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';## Custom headers and headers various browsers *should* be OK with but aren't#add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';## Tell client that this pre-flight info is valid for 20 days#add_header 'Access-Control-Max-Age' 1728000;add_header 'Content-Type' 'text/plain charset=UTF-8';add_header 'Content-Length' 0;return 204;}if ($request_method = 'POST') {add_header 'Access-Control-Allow-Origin' '*';add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';}if ($request_method = 'GET') {add_header 'Access-Control-Allow-Origin' '*';add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';}}location /tf/admin.do {proxy_redirect off; proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://127.0.0.1:8080/tf/login_toLogin.do;}location / {root /usr/share/nginx/html;index  index.html;}}# Load config files from the /etc/nginx/conf.d directory# The default server is in conf.d/default.conf#include /etc/nginx/conf.d/*.conf;}

以上就是关于“ 跨域 · 后台设置:头部header(服务器端添加属性、属性值,浏览器端获取属性及其值) - 数据篇 ” 的全部内容。

跨域 · 后台设置:头部header(服务器端添加属性、属性值,浏览器端获取属性及其值) - 数据篇相关推荐

  1. Javascript跨域后台设置拦截

    子域名之间互相访问需要跨域 结论放在开头: 服务端必须设置允许跨域 客户端带cookie需要设置withCredentials 无论服务端是否允许跨域,该request都会完整执行 options预请 ...

  2. jQuery跨域,添加自定义头部header

    2019独角兽企业重金招聘Python工程师标准>>> 1.前端jQuery代码 $.ajax({crossDomain: true,beforeSend: function(req ...

  3. Android中WebView的跨域漏洞分析和应用被克隆问题情景还原(免Root获取应用沙盒数据)...

    一.前言 去年年底支付宝的被克隆漏洞被爆出,无独有偶就是腾讯干的,其实真正了解这个事件之后会发现,感觉是针对支付宝.因为这个漏洞找出肯定花费了很大劲,主要是因为支付宝的特殊业务需要开启了WebView ...

  4. ajax 跨域 headers JavaScript ajax 跨域请求 +设置headers 实践

    解决跨域调用服务并设置headers 主要的解决方法需要通过服务器端设置响应头.正确响应options请求,正确设置 JavaScript端需要设置的headers信息 方能实现. 此处手札 供后人参 ...

  5. 解决springboot跨域问题No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

    文章目录 1.问题描述 2.问题产生 3.解决方案 1. 在WebMvcConfig添加(推荐使用) 2.直接采用SpringBoot的注解@CrossOrigin 1.Controller层在需要跨 ...

  6. 谷歌浏览器跨域怎么设置

    工具/原料 windows7 谷歌浏览器38.0.2125.114 方法/步骤 首先我们需要打开电脑,在电脑桌面上点击谷歌快捷方式,然后在下拉列表中选择属性,打开属性窗口,切换到快捷方式选项下面,默认 ...

  7. springboot 添加允许跨域_springboot设置cors跨域请求的两种方式

    1.第一种: public class CorsFilter extends OncePerRequestFilter { static final String ORIGIN = "Ori ...

  8. ajxs跨域 php_php设置header头允许ajax跨域请求

    在做项目的时候,我们有时候希望能够可以跨域进行请求,但是ajax访问php接口的时候,通常会报一个错误: Failed to load 你的网址/test.php: No 'Access-Contro ...

  9. 跨域请求设置withCredentials

    最近在做运动城项目,这一个项目下面有多个子项目,如主数据项目,pos项目等.主数据项目的域名为www.topmall.com,POS项目的域名为pos.topmall.com.即两个项目的主域名相同, ...

最新文章

  1. sed和awk中使用shell变量
  2. 好物推荐:notion想同步什么东西,直接在这里写就可以,不用再发消息,真棒
  3. 用jedis访问Redis进行对象存取示例
  4. ZZULIOJ 1067:有问题的里程表
  5. 利兹大学计算机硕士专业排名,2020年利兹大学数学与计算机科学硕士专业硕士申请条件-学费-世界排名...
  6. Linux基本的网络配置
  7. Unity3D命令行Build
  8. float gpu 加速_Javascript如何实现GPU加速?
  9. 2016php面试题及答案,遇见过的PHP面试题
  10. 中级工程师考试2019——地图制图与地理信息系统
  11. WPF在DLL中读取Resource的方法
  12. 路由器选华硕还是tp_家用选TP-LINK路由器好还是华为路由器好
  13. java Doc转Pdf
  14. 人生如常,常亦无常,亦无进,茫然终身,谓常
  15. html动态背景分享,酷炫一款动态背景(HTML +js canvas)
  16. (E4)ENVI-met运行结果处理
  17. 什么是SSH 以及常见的ssh 功能
  18. “十四五”数字泉城建设应用场景
  19. 微信页面隐藏分享按钮
  20. DELL R720服务器4块sas硬盘组成raid5扩容导致的数据丢失如何恢复

热门文章

  1. mbed试玩—高速开发MCU应用(基于FRDM-KL25Z)
  2. windows10 网络热点
  3. Java替代C语言的可能性
  4. 黑马程序员---java基础------------------多线程
  5. 对ios中CGContextRef和image的处理
  6. Magento调用静态块 static block
  7. 微软和Wistron再度联手,Android和Chrome OS又成鱼肉
  8. Enterprise Library 2.0 插件介绍:Avanade Integration Pack
  9. java抽象类例子_关于java抽象类的例子
  10. 判断字符串是否为回文(信息学奥赛一本通-T1146)