我正在使用traefik作为反向代理.我想为入口点设置OAuth2身份验证.在文档中,我发现了我认为可能对此有用的前向身份验证.但该文件太简单了
此配置将首先将请求转发到http://authserver.com/auth.
如果响应代码为2XX,则授予访问权限并执行原始请求.否则,返回来自认证服务器的响应.
我不知道如何在转发中实现身份验证OAuth2?我已经尝试了oauth2_proxy,但没有找到解决方案.
在本期/评论中, guybrush提供了一个解决方案.但事实上,这是一个双反向代理.
我试图example.com使用具有两个S3起源的CloudFront 托管我的网站。S3-main网站和S3-resources资源。
所以我设置S3-main为default(*)。并S3-resources带有路径模式resources/*。
当我去https://example.com我成功加载index.html下S3-main
但当我试图让https://example.com/resorces/something.jpg我再次得到了https://example.com/index.html与像页眉下方:
http GET https://example.com/resources/something.jpg
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: keep-alive
Content-Length: 1518
Content-Type: text/html
Date: Thu, 17 Aug 2017 03:29:52 GMT
ETag: "9776b731a6c42de14c929c10b4fec28c"
Last-Modified: Thu, 17 Aug 2017 01:56:41 GMT
Server: AmazonS3
Via: 1.1 xxxxxxx.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 3OVCtUAk8mGzKt2OJD5gX9KRLHG3CBSHXf-xxxxxxxx==
X-Cache: Error from cloudfront
Run Code Online (Sandbox Code Playgroud)
为什么我得HTTP/1.1 200 OK和X-Cache: Error from cloudfront同一时间?为什么我得到的 …
当我遇到这些行时,我正在阅读 https://use-the-index-luke.com/sql/where-clause/the-equals-operator/concatenated-keys:
在这种情况下,PostgreSQL 数据库使用两个操作:位图索引扫描,然后是位图堆扫描。它们大致对应于 Oracle 的 INDEX RANGE SCAN 和 TABLE ACCESS BY INDEX ROWID,有一个重要区别:它首先从索引中获取所有结果(Bitmap Index Scan),然后根据行在堆表中的物理存储位置对行进行排序然后从表中获取所有行(位图堆扫描)。这种方法减少了表上随机访问 IO 的数量。
我突然想到,当我们在 SSD 上使用 Postgres 时,这毫无意义。排序存储位置的计算可能是一种浪费。因为 SSD 是仅随机访问的设备(如果我没有弄错的话。)
我也做了一些测试,通过打开/关闭 enable_bitmapscan
set enable_bitmapscan to on;
explain analyse select count(distinct myid) from experiment.mytable where name='my_name';
----
QUERY PLAN
Aggregate (cost=63196.06..63196.07 rows=1 width=8) (actual time=668.845..668.846 rows=1 loops=1)
-> Bitmap Heap Scan on mytable (cost=696.41..63110.95 rows=34045 width=82) (actual time=54.967..216.382 rows=178705 loops=1)
Recheck Cond: (name = 'my_name'::text)
Heap Blocks: exact=164942
-> Bitmap Index Scan on mytable_name_visittime_idx …Run Code Online (Sandbox Code Playgroud)