{"id":196,"date":"2023-07-23T16:12:46","date_gmt":"2023-07-23T08:12:46","guid":{"rendered":"https:\/\/boostup.cf\/?p=196"},"modified":"2023-07-23T17:03:32","modified_gmt":"2023-07-23T09:03:32","slug":"vuespringboot%e6%9c%ac%e5%9c%b0%e9%a1%b9%e7%9b%ae%e9%83%a8%e7%bd%b2%e5%88%b0vps%e4%b8%8a%e5%b9%b6%e5%90%af%e7%94%a8https","status":"publish","type":"post","link":"https:\/\/189505.xyz\/?p=196","title":{"rendered":"vue+springboot\u672c\u5730\u9879\u76ee\u90e8\u7f72\u5230vps\u4e0a\u5e76\u542f\u7528https"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_40 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" area-label=\"ez-toc-toggle-icon-1\"><label for=\"item-69e0764d3c77b\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input  type=\"checkbox\" id=\"item-69e0764d3c77b\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/189505.xyz\/?p=196\/#%E6%9C%AC%E5%9C%B0%E9%83%A8%E7%BD%B2\" title=\"\u672c\u5730\u90e8\u7f72\">\u672c\u5730\u90e8\u7f72<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/189505.xyz\/?p=196\/#vps%E9%83%A8%E7%BD%B2%E5%B9%B6%E5%BC%80%E5%90%AFhttps\" title=\"vps\u90e8\u7f72\u5e76\u5f00\u542fhttps\">vps\u90e8\u7f72\u5e76\u5f00\u542fhttps<\/a><ul class='ez-toc-list-level-2'><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/189505.xyz\/?p=196\/#%E9%A1%B9%E7%9B%AE%E4%BF%AE%E6%94%B9\" title=\"\n\u9879\u76ee\u4fee\u6539 \n\">\n\u9879\u76ee\u4fee\u6539 \n<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/189505.xyz\/?p=196\/#%E5%89%8D%E7%AB%AF%E4%BF%AE%E6%94%B9\" title=\"\n\u524d\u7aef\u4fee\u6539 \n\">\n\u524d\u7aef\u4fee\u6539 \n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/189505.xyz\/?p=196\/#lets_encrypt%E7%9A%84pem%E8%AF%81%E4%B9%A6%E8%BD%AC%E6%8D%A2%E6%88%90pkcs12%E8%AF%81%E4%B9%A6\" title=\"\nlet&#8217;s encrypt\u7684pem\u8bc1\u4e66\u8f6c\u6362\u6210pkcs12\u8bc1\u4e66 \n\">\nlet&#8217;s encrypt\u7684pem\u8bc1\u4e66\u8f6c\u6362\u6210pkcs12\u8bc1\u4e66 \n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/189505.xyz\/?p=196\/#%E5%90%8E%E7%AB%AF%E4%BF%AE%E6%94%B9\" title=\"\n\u540e\u7aef\u4fee\u6539 \n\">\n\u540e\u7aef\u4fee\u6539 \n<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/189505.xyz\/?p=196\/#nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86\" title=\"nginx\u53cd\u5411\u4ee3\u7406\">nginx\u53cd\u5411\u4ee3\u7406<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/189505.xyz\/?p=196\/#%E9%83%A8%E7%BD%B2%E9%A1%B9%E7%9B%AE\" title=\"\n\u90e8\u7f72\u9879\u76ee \n\">\n\u90e8\u7f72\u9879\u76ee \n<\/a><ul class='ez-toc-list-level-2'><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/189505.xyz\/?p=196\/#%E5%89%8D%E7%AB%AF%E7%BC%96%E8%AF%91\" title=\"\u524d\u7aef\u7f16\u8bd1\">\u524d\u7aef\u7f16\u8bd1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/189505.xyz\/?p=196\/#%E5%90%8E%E7%AB%AF%E7%BC%96%E8%AF%91\" title=\"\n\u540e\u7aef\u7f16\u8bd1 \n\">\n\u540e\u7aef\u7f16\u8bd1 \n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/189505.xyz\/?p=196\/#%E9%83%A8%E7%BD%B2%E5%88%B0vps%E4%B8%8A\" title=\"\n\u90e8\u7f72\u5230vps\u4e0a \n\">\n\u90e8\u7f72\u5230vps\u4e0a \n<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E6%9C%AC%E5%9C%B0%E9%83%A8%E7%BD%B2\"><\/span>\u672c\u5730\u90e8\u7f72<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u53c2\u8003\u535a\u5ba2https:\/\/learner.blog.csdn.net\/article\/details\/88926242<br \/>\n\u548chttps:\/\/learner.blog.csdn.net\/article\/details\/88955387<br \/>\n\u53ef\u4ee5\u5728\u672c\u5730\u90e8\u7f72<br \/>\n\u5982\u679c\u94fe\u63a5\u5931\u6548\uff0c\u4f5c\u8005\u5220\u9664\u535a\u5ba2\uff0c<br \/>\n\u6211\u6709\u5907\u4efd\u535a\u5ba2:<a href=\"https:\/\/construct.cf\/blogImages\/sites\/vue-sprnig-boot-action-2_files.png\">https:\/\/construct.cf\/blogImages\/sites\/vue-sprnig-boot-action-2_files.png<\/a><br \/>\n\u548chttps:\/\/construct.cf\/blogImages\/sites\/vue-sprnig-boot-action-3_files.png<\/p>\n<h1><span class=\"ez-toc-section\" id=\"vps%E9%83%A8%E7%BD%B2%E5%B9%B6%E5%BC%80%E5%90%AFhttps\"><\/span>vps\u90e8\u7f72\u5e76\u5f00\u542fhttps<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"%E9%A1%B9%E7%9B%AE%E4%BF%AE%E6%94%B9\"><\/span>\n\u9879\u76ee\u4fee\u6539<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E5%89%8D%E7%AB%AF%E4%BF%AE%E6%94%B9\"><\/span>\n\u524d\u7aef\u4fee\u6539<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u9879\u76ee\u91cc\u9762\u7684proxyTable\u548caxios.defaults.baseURL \u662f\u5199\u6b7b\u7684\uff0c\u90e8\u7f72\u5230vps\u4e0a\u5f53\u7136\u8981\u4fee\u6539url\uff0c\u4f7f\u5176\u6307\u5411vps\u4e0a\u7684spring-boot\u76d1\u542c\u7684\u7aef\u53e3<\/p>\n<p>\u4fee\u6539<code><code>wj-vue\/config\/index.js<\/code><\/code>\u548cwj-vue\/src\/main.js<\/p>\n<pre><code>diff --git a\/wj-vue\/config\/index.js b\/wj-vue\/config\/index.js\nindex 0035d33..ba3115f 100644\n--- a\/wj-vue\/config\/index.js\n+++ b\/wj-vue\/config\/index.js\n@@ -12,7 +12,7 @@ module.exports = {\n     assetsPublicPath: &#039;\/&#039;,\n     proxyTable: {\n       &#039;\/api&#039;: {\n-        target: &#039;http:\/\/localhost:8443&#039;,\n+        target: &#039;https:\/\/tacos.boostup.cf:8443&#039;,\n         changeOrigin: true,\n         pathRewrite: {\n           &#039;^\/api&#039;: &#039;&#039;\ndiff --git a\/wj-vue\/src\/main.js b\/wj-vue\/src\/main.js\nindex e88c73d..f049dcf 100644\n--- a\/wj-vue\/src\/main.js\n+++ b\/wj-vue\/src\/main.js\n@@ -4,10 +4,9 @@\n import Vue from &#039;vue&#039;\n import App from &#039;.\/App&#039;\n import router from &#039;.\/router&#039;\n-\/\/ \u8bbe\u7f6e\u53cd\u5411\u4ee3\u7406\uff0c\u524d\u7aef\u8bf7\u6c42\u9ed8\u8ba4\u53d1\u9001\u5230 http:\/\/localhost:8443\/api\n \/\/var axios = require(&#039;axios&#039;) \/\/\u8fd9\u79cd\u5199\u6cd5\u5bfc\u81f4https:\/\/github.com\/axios\/axios\/issues\/5053\n import axios from &#039;axios&#039;\n-axios.defaults.baseURL = &#039;http:\/\/localhost:8443\/api&#039;\n+axios.defaults.baseURL = &#039;https:\/\/tacos.boostup.cf:8443\/api&#039;\n \/\/ \u5168\u5c40\u6ce8\u518c\uff0c\u4e4b\u540e\u53ef\u5728\u5176\u4ed6\u7ec4\u4ef6\u4e2d\u901a\u8fc7 this.$axios \u53d1\u9001\u6570\u636e\n Vue.prototype.$axios = axios\n Vue.config.productionTip = false<\/code><\/pre>\n<h3>\nlet's encrypt\u7684pem\u8bc1\u4e66\u8f6c\u6362\u6210pkcs12\u8bc1\u4e66<br \/>\n<\/h3>\n<p>\u5982\u4f55\u83b7\u53d6pem\u8bc1\u4e66\uff0c\u53ef\u4ee5\u53c2\u8003\u535a\u5ba2:<a href=\"https:\/\/189505.xyz\/?p=191\">https:\/\/189505.xyz\/?p=191<\/a><br \/>\n<br \/>\n\u7136\u540e\u662f\u8f6c\u6362:<\/p>\n<pre><code>cd \/etc\/letsencrypt\/live\/tacos.boostup.cf\/\nopenssl pkcs12 -export -in fullchain.pem  -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root<\/code><\/pre>\n<p>\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2aexport\u5bc6\u7801\uff0c\u81ea\u884c\u8bbe\u7f6e\u3002\u8fd9\u4e2a\u5bc6\u7801\u8981\u5199\u5230spring\u7684\u914d\u7f6e\u4e2d<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%90%8E%E7%AB%AF%E4%BF%AE%E6%94%B9\"><\/span>\n\u540e\u7aef\u4fee\u6539<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4e3a\u4e86\u65b9\u9762\u533a\u522b\u672c\u5730\u5f00\u53d1\u548c\u7ebf\u4e0a\u90e8\u7f72\uff0c\u6211\u4eec\u7ed9vps\u90e8\u7f72\u589e\u52a0\u4e00\u4e2a\u4e0d\u540c\u7684profile\uff0c\u65b0\u5efawj\/src\/main\/resources\/application-vps.properties\uff0c\u5185\u5bb9\u5982\u4e0b\uff0c\u91cd\u70b9\u5173\u6ce8ssl\u76f8\u5173\u90e8\u5206\u3002\u5176\u4e2d\u8bc1\u4e66\u7684\u751f\u6210\u5728\u4e0a\u8282\u6709\u8bb2<\/p>\n<pre><code># \u7aef\u53e3\u914d\u7f6e\nserver.port=8443\n# ssl\nsecurity.require-ssl=true\nserver.ssl.key-store:\/etc\/letsencrypt\/live\/tacos.boostup.cf\/keystore.p12\nserver.ssl.key-store-password: your_pass_word #\nserver.ssl.keyStoreType: PKCS12\nserver.ssl.keyAlias: tomcat\n# endof ssl<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86\"><\/span>nginx\u53cd\u5411\u4ee3\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>server {\n    listen       443 ssl;\n    server_name  tacos.boostup.cf;\n\n    charset utf-8;\n    ssl_certificate \/etc\/letsencrypt\/live\/tacos.boostup.cf\/fullchain.pem;\n    ssl_certificate_key \/etc\/letsencrypt\/live\/tacos.boostup.cf\/privkey.pem;\n\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;\n    ssl_ecdh_curve secp384r1;\n    ssl_prefer_server_ciphers on;\n    ssl_session_cache shared:SSL:10m;\n    ssl_session_timeout 10m;\n    ssl_session_tickets off;\n    keepalive_timeout 70;\n    location \/ {\n    proxy_pass   https:\/\/127.0.0.1:8443;\n    }\n}<\/code><\/pre>\n<h1><span class=\"ez-toc-section\" id=\"%E9%83%A8%E7%BD%B2%E9%A1%B9%E7%9B%AE\"><\/span>\n\u90e8\u7f72\u9879\u76ee<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"%E5%89%8D%E7%AB%AF%E7%BC%96%E8%AF%91\"><\/span>\u524d\u7aef\u7f16\u8bd1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>npm  run build<\/code><\/pre>\n<p>\u751f\u6210\u7684dist\u76ee\u5f55\uff0cdist\u4e0b\u7684index.html\u548cstatic\u590d\u5236\u5230\u540e\u7aef\u9879\u76ee\u7684src\/main\/resources\/static\/\u76ee\u5f55\u4e0b<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%90%8E%E7%AB%AF%E7%BC%96%E8%AF%91\"><\/span>\n\u540e\u7aef\u7f16\u8bd1<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>mvn clean package<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E9%83%A8%E7%BD%B2%E5%88%B0vps%E4%B8%8A\"><\/span>\n\u90e8\u7f72\u5230vps\u4e0a<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>scp jar\u5305\u5230vps\u4e0a\uff0c<br \/>\n\u91cd\u65b0\u542f\u52a8nginx, java -jar wj-1.0.0.jar  --spring.profiles.active=vps\u8fd0\u884cspring\u9879\u76ee\u3002<br \/>\n<br \/>\n<a href=\"https:\/\/tacos.boostup.cf\/#\/login\">https:\/\/tacos.boostup.cf\/#\/login<\/a><br \/>\n\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\u5c31\u53ef\u4ee5\u8df3\u8f6c\u5230index\u9875\u9762<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5730\u90e8\u7f72 \u53c2\u8003\u535a\u5ba2https:\/\/learner.blog.csdn.net\/article\/details\/ &#8230; <a title=\"vue+springboot\u672c\u5730\u9879\u76ee\u90e8\u7f72\u5230vps\u4e0a\u5e76\u542f\u7528https\" class=\"read-more\" href=\"https:\/\/189505.xyz\/?p=196\" aria-label=\"More on vue+springboot\u672c\u5730\u9879\u76ee\u90e8\u7f72\u5230vps\u4e0a\u5e76\u542f\u7528https\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/posts\/196"}],"collection":[{"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/189505.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=196"}],"version-history":[{"count":18,"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":215,"href":"https:\/\/189505.xyz\/index.php?rest_route=\/wp\/v2\/posts\/196\/revisions\/215"}],"wp:attachment":[{"href":"https:\/\/189505.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/189505.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/189505.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}