簡體   English   中英

在Hybris中設置mod_jk重定向

[英]Setting up mod_jk redirect in Hybris

我已經在我的應用服務器中安裝了Apache httpd 2.2.15。 當我點擊https://dev.xxyy.com/login時,我需要獲取登錄頁面( https:// ip_address:9002 / xxstorefront / xx / en / USD / login )。 我已經為我的域安裝了SSL證書,並在重定向規則下進行了設置。

ProxyPass         /login http://localhost:9001/xxstorefront/xx/en/USD/login
ProxyPassReverse  /login http://localhost:9001/xxstorefront/xx/en/USD/login
ProxyPass         /login https://localhost:9002/xxstorefront/xx/en/USD/login
ProxyPassReverse  /login https://localhost:9002/xxstorefront/xx/en/USD/login

RewriteEngine On
RewriteRule ^(.*)/login http://%{ip_address:9001}$1/{xxstorefront/xx/en/USD/login}$2 [L,R] 

當我點擊https://dev.xxyy.com/login時 ,出現以下錯誤,

Not Found 
The requested URL /login was not found on this server.
Apache/2.2.15 (CentOS) Server at dev.xxyy.com Port 443 

當我點擊https://dev.xxyy.com時 ,我得到了apache默認主頁。

請指導我如何設置重定向規則。

您的配置無效。 這兩行:

ProxyPass         /login https://localhost:9002/xxstorefront/xx/en/USD/login
ProxyPassReverse  /login https://localhost:9002/xxstorefront/xx/en/USD/login

覆蓋這兩個:

ProxyPass         /login http://localhost:9001/xxstorefront/xx/en/USD/login
ProxyPassReverse  /login http://localhost:9001/xxstorefront/xx/en/USD/login

Rewite機制可能根本不起作用:

RewriteEngine On
RewriteRule ^(.*)/login http://%{ip_address:9001}$1/{xxstorefront/xx/en/USD/login}$2 [L,R]

我認為這種配置應該可以解決您的問題:

<VirtualHost *:80>
    ServerName        dev.xxyy.com

    ProxyPreserveHost On
    ProxyPass         / http://localhost:9001/xxstorefront/xx/en/USD/
    ProxyPassReverse  / http://localhost:9001/xxstorefront/xx/en/USD/
</VirtualHost>

<VirtualHost *:443>
    ServerName        dev.xxyy.com

    SSLEngine on
    // other SSL directives

    ProxyPreserveHost On
    ProxyPass         / https://localhost:9002/xxstorefront/xx/en/USD/
    ProxyPassReverse  / https://localhost:9002/xxstorefront/xx/en/USD/
</VirtualHost>

它定義了兩個虛擬主機,它們充當代理並將所有請求映射到xxstorefront/xx/en/USD/...

http://dev.xxyy.com/(.*) → http://localhost:9001/xxstorefront/xx/en/USD/(.*)
https://dev.xxyy.com/(.*) → https://localhost:9002/xxstorefront/xx/en/USD/(.*)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM