问题原文
原帖链接 · Veerendra K · CC BY-SA 3.0
Sounds like a basic question, but I don't know about apache config. Any help would be great.
Since Open TSDB wont support https to send data(via REST API), we want to create a https proxy in apache or "Apache Tomcat". For example, the local machine has both TSDB and Apahce. The apache should accept http and https, if I send any to https://<PUBLIC IP>/api/input, it should forward to TSDB in that same machine (Or TSDB could be in different machine) with http.
The big picture
MY Code<---->https://<PUBLIC IP>/api/input<----Proxy to---->http://localhost/api/input
Above I mentioned Apache Tomcat because, mainly we are using Apache Tomcat for other purpose so, first priority is Tomcat(Is it possible with Tomcat?).
NOTE: I know the difference between Apache and Apache Tomcat: Apache is http web server handles the http traffic only, tomcat is servelet container to process the request(For Java only). In build Tomcat has Apache.(Please correct me, if I am wrong)
已采纳解答
原帖链接 · Daniel Ferradal · CC BY-SA 3.0
In Apache HTTPD basically it would be like this:
<VirtualHost *:80>
ServerName publicname.example.com
Redirect / https://publicname.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName publicname.example.com
SSLEngine on
SSLCertificateFile /path/to/cert.pem
SSLCertificateKeyFile /path/to/key.pem
ErrorLog /path/to/logs/publicaname.example.com-ssl-error.log
CustomLog /path/to/logs/publicaname.example.com-ssl.log combined
ProxyPass /api/input http://127.0.0.1:8080/api/input
ProxyPassReverse /api/input http://127.0.0.1:8080/api/input
</VirtualHost>
Note: you will need mod_proxy and mod_proxy_http modules loaded first.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
