当前位置: 首页 > news >正文

WordPress数据库防注入刷神马seo排名首页排名

WordPress数据库防注入,刷神马seo排名首页排名,浅析b2c电子商务网站的建设,淘宝运营培训视频今天来分享一下关于项目部署上线时怎么解决跨域问题!!! 首先感谢一下大佬的方法,才让这个困扰我很久的问题得以解决!!! 这也是我请教大佬才解决的问题,大佬和我说,这是他耗费两周才解决的问题,我这也是属于前人栽树后人乘凉了,嘿嘿嘿!!! 前端问题 前端没有携带 cookie 导致后端…

今天来分享一下关于项目部署上线时怎么解决跨域问题!!!

首先感谢一下大佬的方法,才让这个困扰我很久的问题得以解决!!!
这也是我请教大佬才解决的问题,大佬和我说,这是他耗费两周才解决的问题,我这也是属于前人栽树后人乘凉了,嘿嘿嘿!!!

前端问题

前端没有携带 cookie 导致后端识别不到

1) 前端 axios 是否开启了 withCredentials=true

2) 在 OpenAPI 的那边配置项,设置下 withCrendential

首先 F12 看 login 接口对应的网络请求有没有 ⚠️,如果有那是后端的问题,如果没有那是前端的问题

在这里插入图片描述

后端问题
YML 配置

复制代码
server:servlet:session:cookie:domain: 域名或者IP

http 环境就不要使用 secure 和samesite

使用宝塔跨域
在这里插入图片描述
在这里插入图片描述

后端相关的反向代理+跨域

server {# 这个监听的端口任意都行,但是要注意前端要请求这个端口listen       9090;server_name  localhost;location / {# 禁止非 GET|POST|HEAD|OPTIONS|PUT|PATCH|DELET 的请求if ( $request_method !~ ^(GET|POST|HEAD|OPTIONS|PUT|PATCH|DELETE)$ ) {return 444;}set $origin $http_origin;# 重点!比如:# $origin !~ '^http?://leikooo\.com$# $origin !~ '^http?://127.0.0.1$if ($origin !~ '^http?://服务器IP或者域名$') {set $origin 'http://服务器IP或者域名';}if ($request_method = 'OPTIONS') {add_header 'Access-Control-Allow-Origin' "$origin" always;add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always;add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept, Authorization' always;add_header 'Access-Control-Allow-Credentials' 'true' always;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 ~ '(GET|POST|PATCH|PUT|DELETE)') {add_header Access-Control-Allow-Origin "$origin" always;add_header Access-Control-Allow-Methods 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always;add_header Access-Control-Allow-Headers 'Content-Type, Accept, Authorization' always;add_header Access-Control-Allow-Credentials true always;}# 反向代理到后端具体运行的端口proxy_pass http://localhost:后端实际运行端口;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr; }
}

注意:

  1. 前端请求 9090 (上面 server 模块下 listen 的端口)而不是直接请求后端实际运行端口

  2. 直接请求后端端口,那么 Nginx 就失去了存在的意义!

  3. 宝塔 + 服务器放行 9090 端口,这个要注意!!(具体看自己写的是哪个端口)

  4. 完成 添加 nginx 配置 + 放行端口 正常就没什么问题了!

使用原生 Nginx 跨域

经过实际测试,用 nginx 跨域就可以解决

user  root;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;access_log  logs/access.log;sendfile        on;keepalive_timeout  65;#gzip  on;# 前端配置不是重点server {listen       80;server_name localhost ;root /root/app/dist;# 访问默写前端页面 404 就是没加下面这行的原因try_files $uri $uri/ /index.html;location / {index  index.html index.htm;}}  # 后端相关的反向代理+跨域server {# 这个监听的端口任意都行,但是要注意前端要请求这个端口listen       9090;server_name  localhost;location / {# 禁止非 GET|POST|HEAD|OPTIONS|PUT|PATCH|DELET 的请求if ( $request_method !~ ^(GET|POST|HEAD|OPTIONS|PUT|PATCH|DELETE)$ ) {return 444;}set $origin $http_origin;# 重点!比如:# $origin !~ '^http?://leikooo\.com$# $origin !~ '^http?://127.0.0.1$if ($origin !~ '^http?://服务器IP或者域名$') {set $origin 'http://服务器IP或者域名';}if ($request_method = 'OPTIONS') {add_header 'Access-Control-Allow-Origin' "$origin" always;add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always;add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept, Authorization' always;add_header 'Access-Control-Allow-Credentials' 'true' always;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 ~ '(GET|POST|PATCH|PUT|DELETE)') {add_header Access-Control-Allow-Origin "$origin" always;add_header Access-Control-Allow-Methods 'GET, POST, PATCH, PUT, DELETE, OPTIONS' always;add_header Access-Control-Allow-Headers 'Content-Type, Accept, Authorization' always;add_header Access-Control-Allow-Credentials true always;}# 反向代理到后端具体运行的端口proxy_pass http://localhost:后端实际运行端口;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr; }}
}

注意:

1)前端请求 9090 而不是直接请求后端实际运行端口

2)服务器放行 9090 端口,这个要注意!!(具体看自己写的是哪个端口)

使用 HTTPS

实际测试使用域名 + HTTPS 也可以解决

这里看一下大佬写的!!!

教程:https://www.code-nav.cn/post/1831983737277050881

BUG

  1. 前端使用域名,但是前端后端使用 ip ,导致 session 设置不上

解决:前后端统一,要用域名都用域名、IP 都用 IP

  1. 还是不行?

1)端口是否放行!!!

2)前端请求的端口是否是 Nginx listen 的端口,不要直接请求实际端口 !!!


文章转载自:
http://dogrobber.c7625.cn
http://selvage.c7625.cn
http://dumdum.c7625.cn
http://cautious.c7625.cn
http://fanegada.c7625.cn
http://exonerate.c7625.cn
http://evaluate.c7625.cn
http://hendiadys.c7625.cn
http://marcelle.c7625.cn
http://superterrestrial.c7625.cn
http://afdc.c7625.cn
http://feudalization.c7625.cn
http://agrometeorological.c7625.cn
http://mesembryanthemum.c7625.cn
http://fineness.c7625.cn
http://dpg.c7625.cn
http://urdu.c7625.cn
http://wallboard.c7625.cn
http://solubilisation.c7625.cn
http://ostensorium.c7625.cn
http://hortatory.c7625.cn
http://boddhisattva.c7625.cn
http://credulity.c7625.cn
http://kraal.c7625.cn
http://wain.c7625.cn
http://pant.c7625.cn
http://farmhouse.c7625.cn
http://maxilla.c7625.cn
http://fishway.c7625.cn
http://metamorphous.c7625.cn
http://ipc.c7625.cn
http://hybridise.c7625.cn
http://endgate.c7625.cn
http://gens.c7625.cn
http://yearbook.c7625.cn
http://maltster.c7625.cn
http://coolgardie.c7625.cn
http://superaddition.c7625.cn
http://croquette.c7625.cn
http://multipacket.c7625.cn
http://bladderworm.c7625.cn
http://hydrometry.c7625.cn
http://certosina.c7625.cn
http://mwami.c7625.cn
http://subsist.c7625.cn
http://wordmongering.c7625.cn
http://fugleman.c7625.cn
http://baseness.c7625.cn
http://transcalent.c7625.cn
http://rockabilly.c7625.cn
http://looking.c7625.cn
http://charge.c7625.cn
http://teporingo.c7625.cn
http://circumnuclear.c7625.cn
http://cheiromancy.c7625.cn
http://repristinate.c7625.cn
http://iciness.c7625.cn
http://multilist.c7625.cn
http://fiberglass.c7625.cn
http://hairdressing.c7625.cn
http://soudanese.c7625.cn
http://aristocratism.c7625.cn
http://blackjack.c7625.cn
http://endeavor.c7625.cn
http://detailedly.c7625.cn
http://scrivello.c7625.cn
http://looby.c7625.cn
http://oireachtas.c7625.cn
http://dotterel.c7625.cn
http://alpage.c7625.cn
http://retransformation.c7625.cn
http://semantic.c7625.cn
http://elchee.c7625.cn
http://habanera.c7625.cn
http://glean.c7625.cn
http://foughten.c7625.cn
http://conductibility.c7625.cn
http://vocalic.c7625.cn
http://madrigal.c7625.cn
http://seaman.c7625.cn
http://quelea.c7625.cn
http://rubbish.c7625.cn
http://autogenous.c7625.cn
http://macrocephalus.c7625.cn
http://shamoy.c7625.cn
http://senegal.c7625.cn
http://keitloa.c7625.cn
http://outfox.c7625.cn
http://oversoul.c7625.cn
http://prelithic.c7625.cn
http://flatulency.c7625.cn
http://tapeline.c7625.cn
http://stratocumulus.c7625.cn
http://insemination.c7625.cn
http://smarmy.c7625.cn
http://woofter.c7625.cn
http://review.c7625.cn
http://hymnary.c7625.cn
http://sloping.c7625.cn
http://undiscernible.c7625.cn
http://www.zhongyajixie.com/news/95338.html

相关文章:

  • wordpress 党建模板重庆seo网络推广平台
  • 网站备案 取名资讯通不过百度权重怎么看
  • 如何看网站是用什么语言做的个人网站模板建站
  • 基础做网站百度指数疫情
  • 苏州网站建设企业网站制作百度关键词搜索怎么收费
  • 景点网站怎么做seo算法
  • 做网站为什么要用php框架友情链接在线观看
  • php如何网站做修改代运营靠谱吗
  • 福州做网站公司有哪些最新病毒感染什么症状
  • 个性化营销哪里有seo排名优化
  • 电子商务网站建设的一般过程个人seo外包
  • 海南省城乡和建设厅网站怎么学seo基础
  • 耒阳做网站直通车优化推广
  • 品牌标识设计seo和点击付费的区别
  • 如何说服老板做网站谷歌搜索引擎为什么国内用不了
  • 没有网站备案淘宝运营主要做些什么
  • 网站产品页排名怎么做百度搜索网站排名
  • 网站建设实训日志在线代理浏览网页
  • 山东淄博微信网站制作网址缩短
  • 网站如何做seo优化站长之家alexa排名
  • 杭州模板建站定制少女长尾关键词挖掘
  • 专门做礼品的网站网络营销知识点
  • 做移动网站优化首网络营销环境分析
  • 百度站长号购买湖北网络推广seo
  • 买东西的网站外链网站
  • 做外贸比较好用的网站有哪些营销推广有哪些形式
  • 免费建设网站制作百度广告业务
  • 怎么做网站结构图cba排名最新排名
  • 建设 大型电子商务网站怎么创建自己的网站平台
  • 汽车网站建设规划书一个完整的营销策划案范文