AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-796572

Ress's questions

Martin Hope
Ress
Asked: 2022-12-10 11:36:54 +0800 CST

ProxyPass 不能与 ProxyPassMatch 一起使用

  • 5

所以目前我在我的 Oracle HTTP Server 实例上配置了一个虚拟主机,其中包含 ProxyPass:

ProxyPass ^/test/home/ https://example.com/
ProxyPassMatch ^/test/home/(.*)$ https://example.com/$1
ProxyPassReverse ^/test/home/(.*)$ https://example.com/$1

当我尝试访问https://mywebsite.com/test/home/<url_from_other_server>时,请求似乎按预期工作。但是,当我尝试访问时https://mywebsite.com/test/home/,它并没有代理我,https://example.com/而是返回 404。

ProxyPassMatch通配符似乎适用于我尝试访问的所有子网址,但常规关键字ProxyPass无效。

我也尝试过ProxyPass完全删除并在尝试访问 /test/home/ 时遇到相同的 404 错误

有谁知道是什么导致了这种奇怪的行为?

谢谢你。

apache-2.2
  • 2 个回答
  • 46 Views
Martin Hope
Ress
Asked: 2021-11-20 07:41:09 +0800 CST

压缩从“grep-ril”命令返回的所有文件

  • 0

我grep -ril用来查看所有包含特定字符串的文件:

[user@machine]$ grep -ril "test string"
file1.log
file2.log
file3.log
file4.log
...

然后我想压缩该命令返回的所有文件。这可能吗?

我已经尝试过诸如grep -ril myPattern | zip files.zip但grep -ril myPattern | zip > files.zip到目前为止没有任何效果。

有解决方法吗?

谢谢你。

bash grep zip
  • 2 个回答
  • 96 Views
Martin Hope
Ress
Asked: 2021-10-05 03:02:26 +0800 CST

在“命令”任务中动态传递 json 作为参数

  • 0

我的剧本中有这个任务:

- name: Update instance tags
    command: oci compute instance update -c {{ compartment }} --freeform-tags {{ tag_var_json }}

根据该命令的oracle 文档,该参数--freeform-tags接受一个表示标签键值对的 json。我需要在剧本本身中动态创建这个 json,所以在运行该任务之前,我有一个用于测试目的:

  - name: Create a json object to use as tag
    set_fact:
      tag_var: '{ "test": "thisisatest" }'
    set_fact:
      tag_var_json: "{{ tag_var | to_json }}"

但我一定是做错了什么,因为我不断收到这个错误:
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'tag_var' is undefined

有没有更简单的方法可以直接在剧本中创建 json 并将其作为参数传递给该参数?

谢谢你。

json ansible
  • 1 个回答
  • 207 Views
Martin Hope
Ress
Asked: 2021-08-21 01:05:21 +0800 CST

从ansible上的字符串中删除特定字符

  • 1

我有以下

- set_fact:
   test_result: " {{ htmlres.content | regex_search('http://website([0-9]+)', '\\1') }}"

使用调试,这将返回以下内容" '[01]'"

只想要数字,我使用该replace()函数进行了一些实验,并且能够[ ]通过添加以下内容来去除:

- set_fact:
   test_result: " {{ htmlres.content | regex_search('http://website([0-9]+)', '\\1')
| replace('[','') | replace(']','') }}"

我现在的问题是输出现在是," '01'我似乎无法删除'或空格。

由于某种原因添加| trim到末尾不会删除空格,并且添加regex_search('\'','')似乎也不会逃避角色和工作。

我错过了什么吗?

这是第一次删除后调试的输出:

"msg": [
    " '01'",
    ...

谢谢

regex ansible ansible-playbook strings
  • 1 个回答
  • 8903 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve