我已成功将我的 Spring Boot 应用程序部署到 Ubuntu 18.04 上的 Compute Engine,它位于 Nginx 代理之后,但当前 Nginx 正在监听 80 端口,即 http。我需要设置安全连接。我对一些细节有疑问,我对此很陌生,到目前为止我所做的只是在 IDE 中的 Windows 上编写 spring boot/react js 应用程序。
engine 只部署了后端rest api,前端开启
Netlify,它已经在工作了。我不需要好声音
后端的域名,因为用户不会看到它,只有前端
应用程序将使用 外网IP 我的计算引擎获取数据
从后端。
如果您有任何建议,您可以提供一些建议,我只是想与我的后端 spring boot 应用程序建立安全连接,该应用程序位于谷歌计算引擎上的 Nginx 后面,目前仅适用于 HTTP,但不适用于 HTTPs。
最佳答案
1 .从技术上讲,您可以拥有公共(public) IP 的 SSL 证书,但很少使用。更多详情请查看 RFC 5280在这个question .
请记住 如果您的 IP 地址更改,您的 SSL 证书将变得无用 .
我检查了一些 SSL 提供商,发现 您应该是 IP 的所有者才能获得此类 SSL 证书 :
If you decide that you really need an IP in your cert there are specific stipulations, conditions, and limitations to consider. The biggest hurdle for most folks is that the IP address must be specifically assigned to your company or organization (not your ISP or hosting provider) as verified by an IP WHOIS lookup.
Quite frequent question: is it possible to issue an SSL certificate for an IP address (and not for a domain name)? Yes, it is possible. However, there are several requirements:
- Only OV SSL certificates can be issued;
- The company must own IP address (validation based on WHOIS information of IP-addresses).
An IP address SSL certificate secures connections directly with the IP address submitted. Whereas typically an SSL certificate is issued to a Fully Qualified Domain Name (FQDN), some organisations may need to secure an IP address.
Only public IP addresses may be used and you must be the owner of the IP address according to the records at RIPE.
结果,实际上,在 GCE VM 实例的情况下几乎不可能,并且更容易继续使用域证书。
2 .在 GCE 中,与 VM 实例的外部 IP 的所有连接都直接传递到 VM 实例。 GCE 无法自行保护连接。您应该在 VM 实例上配置 SSL 证书。您可以在文档 VPC network overview 中找到更多详细信息和 IP Addresses .
此外,您还可以使用 Google-managed SSL certificates或拥有 external HTTP(S) load balancers 上的 SSL 证书.
关于nginx - 有关 Nginx 如何在 Google 计算引擎上使用 SSL 的详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61913277/