![](/img/trans.png)
[英]How apache reverse proxy can be configured without breaking the https tunnel between client & server?
[英]FIWARE - PEP Proxy configured to HTTPS
我想知道我如何配置 PEP 代理,以便我可以通過 HTTPS 交換消息。 我有一個 Orion 上下文代理的實例,只有在通過 PEP 代理后才能訪問它。 我的PEP 代理 (Wilma)配置文件 (config.js) 包含以下內容:
config.https = {
enabled: true,
cert_file: 'cert/idm.crt',
key_file: 'cert/idm.key',
port: 443
};
config.account_host = 'https://localhost:8000'; //account.lab.fiware.org';
config.keystone_host = 'localhost'; //'cloud.lab.fiware.org';
config.keystone_port = 5000; //4731;
config.app_host = 'https://orion'; //'localhost';
config.app_port = ''; //Nginx is configured to redirect to port 1026
// Use true if the app server listens in https
config.app_ssl = true;
config.username = 'pep_proxy_credential_obtained_at_portal';
config.password = 'password_obtained_at_portal';
我還有 HTTPS 到 HTTP(Nginx 配置為反向代理),以便我直接發送到 Orion 的請求是安全的。 HTTPS 僅在沒有 PEP 代理流的情況下工作。 當我插入授權/身份驗證流程時,我遇到了問題,因為 PEP 代理不處理 SSL 證書。 這是Nginx 的配置:
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://orion:1026;
proxy_read_timeout 90;
proxy_redirect http://orion:1026 https://orion;
}
我想以一種只能通過 HTTPS 與 Orion 通信的方式集成我所擁有的,包括 PEP 代理流。 我已經搜索過,但沒有發現與 PEP 代理中的 HTTPS 配置相關的任何有用信息。
編輯:PEP 代理重定向到應用程序時出現錯誤:
2017-01-17 20:52:55.544 - INFO: Server - Success authenticating PEP proxy.
Proxy Auth-token: d7ec08edd87d43418edfd558df26f427
2017-01-17 20:53:49.450 - INFO: IDM-Client - Checking token with IDM...
2017-01-17 20:53:49.508 - INFO: Root - Access-token OK. Redirecting to app...
Refused to set unsafe header "accept-encoding"
Refused to set unsafe header "content-length"
應用程序出現的錯誤是:
('Connection aborted.', BadStatusLine('HTTP/1.1 0 unknown\r\n',))
問題是配置中的https:
config.app_host = 'https://orion';
我必須調試才能找到這個。 PEP 代理 Wilma 將協議(http 或 https)添加到配置的應用程序主機。 正確的是在沒有協議的情況下進行配置:
config.app_host = 'orion';
也許這個觀察可以添加到 Wilma 文檔中,以避免像我這樣的錯誤。
您可以使用配置文件中的參數“https”將 PEP 代理配置為偵聽 HTTPS
https://github.com/ging/fiware-pep-proxy/blob/master/config.js.template#L7
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.