Reactjs 如何在Spring boot(后端)和#x2B中使用SSL证书;React.js(前端)应用程序

Reactjs 如何在Spring boot(后端)和#x2B中使用SSL证书;React.js(前端)应用程序,reactjs,spring,spring-boot,ssl,Reactjs,Spring,Spring Boot,Ssl,我的Spring boot(后端)应用程序正在服务器上运行。端口=8080 前端React应用程序正在端口=80上运行 我在CentOS服务器上的httpd中安装了付费SSL.crt和.key文件 但是我无法用https运行我的应用程序,但它是用http运行的。因为您已经为HTTPD配置了SSL,所以您可以在配置HTTPD时设置一个到spring boot应用程序的代理。如果您想使用nginx作为http服务器,则需要在配置中添加一个以上的location对象,如下所示 location /sp

我的Spring boot(后端)应用程序正在服务器上运行。端口=8080 前端React应用程序正在端口=80上运行 我在CentOS服务器上的httpd中安装了付费SSL.crt和.key文件
但是我无法用https运行我的应用程序,但它是用http运行的。因为您已经为HTTPD配置了SSL,所以您可以在配置HTTPD时设置一个到spring boot应用程序的代理。如果您想使用nginx作为http服务器,则需要在配置中添加一个以上的location对象,如下所示

location /springbootapp/ {
                proxy_set_header Host $http_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;
                proxy_set_header Connection "";
                proxy_redirect off;
                proxy_pass http://localhost:8080/;
        }
您需要将react应用程序中定义为location(“/springbootapp/”)的字符串作为后端url提供给您