快速问题:我如何调试入口和 Nginx 以了解 HTTP->HTTPS 重定向发生的确切位置?
更多细节:
我们有什么:我们有 war 文件 + Tomcat,用 Docker 构建它。在 AWS 中使用 Kubernetes 运行它。
我们需要的是:应用程序应该可以通过 HTTP 和 HTTPS 访问。HTTP不应重定向到 HTTPS。
问题:HTTP 总是重定向到 HTTPS。
我们的尝试:我们有 Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ${some name
namespace: ${some namespace}
labels:
app: ${some app}
env: ${some env}
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false" #we added this for turn off https redirection
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" #we added this for turn off https redirection
nginx.ingress.kubernetes.io/affinity: "cookie" # We use it for sticky …Run Code Online (Sandbox Code Playgroud) 在客户端,我们有使用过滤器搜索的端点。
在后端,我有在 Postgresql DB 中搜索的方法。选项之一 - 搜索 jsonb 字段。
在这一天之前,我搜索了values和keys。我的代码是:
if (appFilter.getSearchValue() != null) {
criteria.add(Restrictions.sqlRestriction("UPPER(values::text) LIKE '%" + appFilter.getSearchValue().toUpperCase() + "%'"));
}
Run Code Online (Sandbox Code Playgroud)
SQL 模拟(UPPER- 不是强制性的):
SELECT *
FROM application
WHERE UPPER(values :: TEXT) LIKE '%some text%'
Run Code Online (Sandbox Code Playgroud)
现在我只需要搜索values。用于此目的的 SQL 查询:
SELECT *
FROM application, LATERAL json_each_text(application.values :: JSON)
WHERE value :: TEXT LIKE '%some text%';
Run Code Online (Sandbox Code Playgroud)
我如何将其添加到限制中?也许还有其他用于搜索值的变体?休眠 5.0.12
我以编程方式将图像粘贴到docx中。但是结果是布局不适合我。面临缺乏文档的情况。我需要更改图像换行(布局)。例如现在我有这个:
但是要这样:
UPD1:我的工作:依次遍历各段,然后遍历各个运行,并找到带有特殊书签的特定运行。在此运行中,我添加图片:
XWPFPicture pic = run.addPicture(
new ByteArrayInputStream(picSource),
Document.PICTURE_TYPE_PNG,
"pic",
Units.toEMU(100),
Units.toEMU(30));
Run Code Online (Sandbox Code Playgroud)
UPD2:研究了此类内的一些有趣的东西:
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor
Run Code Online (Sandbox Code Playgroud)
方法setWrapTight(CTWrapTight var1)。可能是这样。仍然不知道如何将其应用于我的代码。
UPD3:最终我来到了这里(currentRun-运行我们的图片):
CTWrapTight ctWrapTight = currentRun.getCTR().getDrawingList().get(0).addNewAnchor().addNewWrapTight();
CTWrapPath ctWrapPath = ctWrapTight.addNewWrapPolygon();
CTPoint2D ctStart = ctWrapPath.addNewStart();
ctStart.setX(0L);
ctStart.setY(0L);
CTPoint2D ctLineTo1 = ctWrapPath.addNewLineTo();
CTPoint2D ctLineTo2 = ctWrapPath.addNewLineTo();
CTPoint2D ctLineTo3 = ctWrapPath.addNewLineTo();
ctLineTo1.setX(21384L);
ctLineTo1.setY(20520L);
ctLineTo2.setX(21384L);
ctLineTo2.setY(0L);
ctLineTo3.setX(0L);
ctLineTo3.setY(0L);
ctWrapTight.setWrapText(STWrapText.BOTH_SIDES);
Run Code Online (Sandbox Code Playgroud)
但是当我尝试打开它时,它会分解文档:
我们很抱歉。我们无法打开文档,因为我们发现其内容存在问题。
依赖关系是:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud) java ×2
apache-poi ×1
docx ×1
hibernate ×1
https ×1
json ×1
kubernetes ×1
nginx ×1
postgresql ×1