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-62357

Madhur Ahuja's questions

Martin Hope
Madhur Ahuja
Asked: 2016-12-27 10:31:19 +0800 CST

NGINX + Lua:根据上游响应头设置缓存键

  • 1

我正在尝试使用上游响应标头字段值来控制缓存键。有问题的标题字段在Common-Api下面的配置中。

我不断得到nginx: [emerg] unknown "ck" variable。知道我做错了什么吗?

 location ~^/(deals-new)/ {
            set $no_cache 0;
            proxy_cache helpchat_cache;

            proxy_cache_min_uses 1;
            #proxy_cache_valid  200 302 10m;
            proxy_cache_valid  404 1m;
            #proxy_cache_lock on;
            proxy_cache_use_stale error timeout updating invalid_header http_500 http_502 http_503 http_504;

            client_max_body_size 25M;
            #auth_basic "closed website";
            #auth_basic_user_file /etc/nginx/htpasswd;
            root   /usr/share/nginx/html;
            index  index.html index.htm;

            # if ($request_uri ~* ".(jsp|sh|pl|jsp|sh|pl|jpg|jpeg|gif|gz|zip|flv|rar|wmv|avi|css|swf|png|htc|ico|mpeg|mpg|txt|mp3|mov|js)(\?v=[0-9.]+)?$") {
            #   return 404;
            #   break;
            # }

            #Proxy all the requests to Tomcat
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            # Go to next upstream after if server down.
            #proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
            #proxy_cache_methods GET HEAD POST;
            proxy_ignore_headers Expires Cache-Control;
            proxy_set_header Accept-Language 'en-US';
            add_header X-Upstream $upstream_addr always;

            add_header X-Cache-Status $upstream_cache_status always;
            add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
            #add_header X-Cache-Expiry $http_x_accel_expires;
            #Pass to tomcat backend
            proxy_pass http://tomcatcluster;
            if ($cors = true ) {
                add_header Access-Control-Allow-Origin "$http_origin"; # <- needs to be updated
                add_header Access-Control-Allow-Methods "GET, OPTIONS";
                add_header Access-Control-Allow-Headers "Authorization,User-Agent,Keep-Alive,Content-Type,x-akosha-auth";   # <- You may not need this...it's for Basic Auth
                add_header Access-Control-Allow-Credentials "true";        # <- Basic Auth stuff, again
            }
            if ($request_method = OPTIONS ) {
                add_header Access-Control-Allow-Origin "$http_origin"; # <- needs to be updated
                add_header Access-Control-Allow-Methods "GET, OPTIONS";
                add_header Access-Control-Allow-Headers "Authorization,User-Agent,Keep-Alive,Content-Type,x-akosha-auth";   # <- You may not need this...it's for Basic Auth
                add_header Access-Control-Allow-Credentials "true";        # <- Basic Auth stuff, again
                return 200;
            }

             header_filter_by_lua_block {

                ngx.header["test"] = "madhur"
                ngx.header["test1"]=ngx.resp.get_headers()['Common-Api'] 
                if ngx.resp.get_headers()['Common-Api'] == "true" then
                    ngx.var.proxy_cache_key = "$http_x_device_type$http_x_app_version_code$http_origin_api_cache_$user_agent_helpchat$host$request_uri";
                    ngx.var.ck = "$http_x_device_type$http_x_app_version_code$http_origin_api_cache_$user_agent_helpchat$host$request_uri";
                end

                if ngx.resp.get_headers()['Common-Api'] == nil then
                    ngx.var.proxy_cache_key = "$http_x_device_type$http_x_app_version_code$http_x_akosha_auth$http_x_helpchat_auth$http_origin_api_cache_$user_agent_helpchat$host$request_uri";
                    ngx.var.ck = "$http_x_device_type$http_x_app_version_code$http_x_akosha_auth$http_x_helpchat_auth$http_origin_api_cache_$user_agent_helpchat$host$request_uri";
                end

            }
            add_header X-Cache-Key $ck always;


        }
nginx lua
  • 1 个回答
  • 2611 Views
Martin Hope
Madhur Ahuja
Asked: 2016-06-25 05:56:02 +0800 CST

HAProxy 背后的滚动更新

  • 2

我正在使用一个由在 CentOS 主机上运行的 docker 容器组成的基础设施平台。

  • 通过 docker compose 扩展多个容器。
  • 服务发现的领事。
  • 服务注册的注册器
  • HAProxy 作为负载均衡器
  • 每次添加/删除容器时生成 haproxy 配置的 Consul 模板。

每次我们更新构建时,都会生成新容器并删除旧容器。问题是容器被立即删除,而不考虑容器正在服务的现有请求。理想情况下,我应该有一个信号来标记容器处于维护或排空模式,以便可以服务现有连接,然后先优雅地从 haproxy 中删除,然后再从物理上删除。

有没有人遇到过这个问题,或者通过容器完成了类似的自动缩放工作流。

load-balancing docker haproxy consul
  • 1 个回答
  • 1893 Views
Martin Hope
Madhur Ahuja
Asked: 2013-01-15 22:51:53 +0800 CST

为 WebSphere JVM 进程设置环境变量的地方

  • 1

我有一个在 user 下运行的 websphere 应用程序wsadmin。

应用程序调用 SQL 批量加载程序客户端./sqlldr

sqlldr 需要一些预定义的环境变量才能工作,例如

ORACLE_BASE=/usr/app/oracle ORACLE_HOME=/usr/app/oracle/product/11.2.0.1/client_64
ORACLE_SID=VDO1018

你能告诉我放置这些变量的最佳位置是什么吗?我有几个选择:

1) /etc/profile 或 /etc/environment

2) wsadmin 用户的.bash_profile

我问这个问题的原因是 sqlldr 对我们来说是随机失败的,目前变量放在 .bash_profile 中。由于 .bash_profile 用于登录 shell,我不确定它是否适用于 JVM 进程。

linux
  • 1 个回答
  • 3607 Views
Martin Hope
Madhur Ahuja
Asked: 2013-01-15 00:36:50 +0800 CST

负载平衡节点上的不同 sqlldr 位置

  • 0

我们在运行第三方 WebSphere 应用程序的负载均衡器的集群中有两个节点。

我们注意到两个节点的 ./sqlldr 位置不同。对于一个节点,它的: /usr/app/oracle/product/11.2.0/client

对于另一个,它是:
/usr/app/oracle/product/11.2.0/client_1

我相信这是导致我们的 WebSphere 应用程序出现问题的原因,该应用程序的配置文件只有一个路径用于设置 ./sqlldr 位置。

您能否告诉我如何最好地解决此错误,而无需采取诸如重新安装产品之类的大步骤。

创建符号链接会解决问题吗?

linux
  • 1 个回答
  • 344 Views
Martin Hope
Madhur Ahuja
Asked: 2012-11-30 02:25:43 +0800 CST

在 RHEL 6 上安装 WAS 7.0

  • 0

我正在尝试在 RHEL 6 x64 上安装 Websphere 7 x64。

我正在使用开发版。

当我尝试./install在命令提示符下执行时,它会等待几秒钟然后返回提示符而不会出现任何错误。

我已经安装了本文中列出的所有先决条件:

http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.installation.base.doc%2Finfo%2Faes%2Fae%2Ftins_linuxsetup_rhel6.html

知道如何解决这个问题吗?

linux
  • 1 个回答
  • 1540 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