微海报调用表单

nginx配置
server {listen 80; server_name form.126net.cn testform.126net.com; location /{ #if ( $http_origin ~ *.mxs223.com ){ #set allow_domain #} #add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin "$http_origin"; #add_header Access-Control-Allow-Origin "$http_origin"; #用来指定本次预检请求的有效期,单位为秒,,在此期间不用发出另一条预检请求 add_header Access-Control-Max-Age 3600; #ajax请求要开启 origin 不可设置为* add_header Access-Control-Allow-Credentials 'true'; 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'; #OPTIONS 用来检查服务器的性能。 #例如:AJAX进行跨域请求时的预检,需要向另外一个域名的资源发送一个HTTP OPTIONS请求头, #用以判断实际发送的请求是否安全。 if ($request_method = 'OPTIONS') { #204 2xx(成功)请求执行成功,但是没有数据,浏览器不用刷新页面.也不用导向新的页面 return 204; } proxy_set_header Host $host; proxy_pass http://10.10.10.100:81/; }}