Site updated: 2022-10-14 17:41:26

This commit is contained in:
qinglong
2022-10-14 17:41:27 +08:00
parent e67fb87fe6
commit 4433910317
58 changed files with 145 additions and 63 deletions

View File

@@ -8,7 +8,7 @@
<author>
<name>Hito li</name>
</author>
<updated>2022-10-12T06:40:00.000Z</updated>
<updated>2022-10-14T09:13:00.000Z</updated>
<category term="hito" />
<category term="無言" />
<category term="博客" />
@@ -16,6 +16,33 @@
<category term="笔记" />
<category term="心得体会" />
<category term="踩坑" />
<entry>
<id>https://blog.jingxiyuan.cn/2022/10/14/%E5%85%81%E8%AE%B8%E8%B7%A8%E5%9F%9F%E8%8E%B7%E5%8F%96cookies%E6%96%B9%E6%B3%95/</id>
<title>允许跨域获取cookie的方法</title>
<link rel="alternate" href="https://blog.jingxiyuan.cn/2022/10/14/%E5%85%81%E8%AE%B8%E8%B7%A8%E5%9F%9F%E8%8E%B7%E5%8F%96cookies%E6%96%B9%E6%B3%95/"/>
<content type="html">&lt;h4 id=&#34;使用场景&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#使用场景&#34;&gt;#&lt;/a&gt; 使用场景&lt;/h4&gt;
&lt;p&gt;  在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-conf&#34;&gt;server &amp;#123;
listen port ssl http2;
server_name xxx.com;
ssl_certificate_key /xxx.key;
ssl_certificate /xxx.pem;
proxy_cookie_path ~(.*) &amp;quot;$1; SameSite=None; secure; httponly&amp;quot;;
location / &amp;#123;
#允许镶套的方式(可以同域镶套、指定域名镶套或者所有域名镶套)
add_header X-Frame-Options ALLOWALL; #允许被所有域名镶套
proxy_pass http://xxx;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
</content>
<category term="技术分享" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" />
<category term="nginx" scheme="https://blog.jingxiyuan.cn/tags/nginx/" />
<category term="iframe" scheme="https://blog.jingxiyuan.cn/tags/iframe/" />
<category term="cookie" scheme="https://blog.jingxiyuan.cn/tags/cookie/" />
<updated>2022-10-14T09:13:00.000Z</updated>
</entry>
<entry>
<id>https://blog.jingxiyuan.cn/2022/10/12/%E4%BD%BF%E7%94%A8picgo%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E5%88%B0chevereto/</id>
<title>使用PicGo上传图片到chevereto</title>