如何使用Apache实现Wildly项目的代理?

问题描述 投票:0回答:1

我已经用JSF实现了JavaEE项目,并部署到了我的本地Wildly服务器中。现在,我很好,我可以使用任何浏览器通过键入http://localhost:8080/gestionale/来访问它。现在,我想将项目移至Linux机器上的云中。这样做的目的是通过“加密”(Let's Encrypt)将SSL / TLS设置为Apache,以便对所有数据进行加密,但是我不提起如何在Apache服务器配置中实施此操作的建议。可以用吗?

    <IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName mydomain.com
    ServerAlias www.mydomain.com 
ProxyPass                   /       http://127.0.0.1:8080/gestionale/ 
ProxyPassReverse            /       http://127.0.0.1:8080/gestionale/  

    Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile fullchain.pem
SSLCertificateKeyFile privkey.pem
<IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>

</VirtualHost>
</IfModule>

这个想法是直接使用mydomain.com访问JSF项目:这可能吗?是否所有交换的TLS / SSL数据都安全?

apache wildfly reverse-proxy http-proxy
1个回答
0
投票
<VirtualHost *:80> ServerName www.mydomain.tld ProxyPreserveHost on ProxyPass / http://127.0.0.1:8080/gestionale/ ProxyTimeout 360 </VirtualHost>

然后安装Certbot并按照说明进行操作。例如,在Ubuntu上,您将运行:

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get install certbot python-certbot-apache 
sudo certbot --apache

Certbot将为您更新您的Apache SSL配置。它还会询问您是否要设置从HTTP到HTTPS的重定向(通常是个好主意)。

请确保您的域名在DNS中正确解析,否则您将无法正确运行certbot。这只是HTTP的优势,它仅在开始时可以验证所有设置是否正确。
© www.soinside.com 2019 - 2024. All rights reserved.