{"id":23281,"date":"2025-04-19T07:19:16","date_gmt":"2025-04-18T23:19:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/23281.html"},"modified":"2025-04-19T07:19:16","modified_gmt":"2025-04-18T23:19:16","slug":"ai-sphere-butler%e4%b9%8bubuntu%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a6%82%e4%bd%95%e9%83%a8%e7%bd%b2nginx%e4%bb%a3%e7%90%86%ef%bc%8c%e5%b9%b6%e5%b0%86http%e5%8d%87%e7%ba%a7%e6%88%90https%ef%bc%8c%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/23281.html","title":{"rendered":"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee"},"content":{"rendered":"<h2>\u73af\u5883&#xff1a;<\/h2>\n<p>AI-Sphere-Butler<\/p>\n<p>WSL2<\/p>\n<p>Ubuntu22.04<\/p>\n<p>Nginx<\/p>\n<h2>\u95ee\u9898\u63cf\u8ff0&#xff1a;<\/h2>\n<p>AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406&#xff0c;\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS&#xff0c;\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf249194.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h2>\n<p>\u4e00\u3001\u751f\u6210\u52a0\u5bc6\u8bc1\u4e66<\/p>\n<p>1.\u914d\u7f6eOpenSSL\u751f\u6210\u672c\u5730\u4e0d\u52a0\u5bc6\u8bc1\u4e66<\/p>\n<p>1.\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86 Nginx \u548c OpenSSL&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728 Ubuntu \u4e0a\u5b89\u88c5\u5b83\u4eec&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nginx openssl<\/p>\n<p>2.\u751f\u6210\u81ea\u7b7e\u540dSSL\u8bc1\u4e66<\/p>\n<p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709SSL\u8bc1\u4e66&#xff0c;\u53ef\u4ee5\u6309\u7167\u4e4b\u524d\u547d\u4ee4\u751f\u6210\u4e00\u4e2a\u81ea\u7b7e\u540d\u8bc1\u4e66&#xff0c;\u5047\u8bbe\u4f60\u5df2\u7ecf\u5728 \/etc\/nginx\/ssl \u76ee\u5f55\u4e0b\u751f\u6210\u4e86 private.key \u548c certificate.crt \u6587\u4ef6\u3002<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> -p \/etc\/nginx\/ssl<br \/>\n<span class=\"token builtin class-name\">cd<\/span> \/etc\/nginx\/ssl<br \/>\nopenssl genpkey -algorithm RSA -out private.key<br \/>\nopenssl req -new -key private.key -out csr.csr<br \/>\nopenssl x509 -req -days <span class=\"token number\">365<\/span> -in csr.csr -signkey private.key -out certificate.crt<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf2686c6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/>\u7528\u4e0d\u52a0\u5bc6\u8bc1\u4e66<\/p>\n<p>openssl rsa -in \/etc\/nginx\/ssl\/private.key -out \/etc\/nginx\/ssl\/private_unencrypted.key<\/p>\n<p>\u4e8c\u3001\u90e8\u7f72Nginx\u670d\u52a1<\/p>\n<p>1.\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868<\/p>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u7cfb\u7edf\u8f6f\u4ef6\u5305\u5217\u8868\u662f\u6700\u65b0\u7684&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<\/p>\n<p>2.\u5b89\u88c5Nginx<\/p>\n<p>\u4f7f\u7528apt\u547d\u4ee4\u6765\u5b89\u88c5Nginx&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nginx<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u63d0\u793a\u4f60\u8f93\u5165\u7ba1\u7406\u5458\u5bc6\u7801\u4ee5\u786e\u8ba4\u64cd\u4f5c\u6743\u9650\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf28266b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>3.\u542f\u52a8\u548c\u542f\u7528Nginx<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u542f\u52a8Nginx\u670d\u52a1&#xff0c;\u5e76\u8bbe\u7f6e\u5b83\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start nginx<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> nginx<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Nginx\u7684\u72b6\u6001&#xff0c;\u786e\u4fdd\u5b83\u6b63\u5728\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl status nginx<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf2a3de3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38&#xff0c;\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u201cactive (running)\u201d\u7684\u8f93\u51fa\u3002<\/p>\n<p>4.\u914d\u7f6e\u9632\u706b\u5899<\/p>\n<p>\u5982\u679c\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u542f\u7528\u4e86UFW&#xff08;Uncomplicated Firewall&#xff09;&#xff0c;\u8981\u9700\u8981\u5141\u8bb8HTTP\u548cHTTPS\u6d41\u91cf&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> ufw allow <span class=\"token string\">&#039;Nginx Full&#039;<\/span><\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u5c06\u5141\u8bb8\u901a\u8fc7HTTP&#xff08;\u7aef\u53e380&#xff09;\u548cHTTPS&#xff08;\u7aef\u53e3443&#xff09;\u7684\u6d41\u91cf\u3002\u5982\u679c\u4f60\u60f3\u53ea\u5141\u8bb8HTTP\u6216HTTPS&#xff0c;\u53ef\u4ee5\u5206\u522b\u4f7f\u7528&#039;Nginx HTTP&#039;\u6216&#039;Nginx HTTPS&#039;\u3002<\/p>\n<p>5.\u9a8c\u8bc1Nginx\u5b89\u88c5<\/p>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668\u5e76\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668IP\u5730\u5740\u6216\u57df\u540d&#xff08;\u4f8b\u5982&#xff1a;http:\/\/your_server_ip&#xff09;\u3002\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u9ed8\u8ba4\u7684Nginx\u6b22\u8fce\u9875\u9762&#xff0c;\u8868\u660eNginx\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u5e76\u8fd0\u884c\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf2d477a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> 6.\u57fa\u672c\u914d\u7f6e\u6587\u4ef6\u8def\u5f84<\/p>\n<ul>\n<li>\u4e3b\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/nginx\/nginx.conf<\/li>\n<li>\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6&#xff1a;\u901a\u5e38\u4f4d\u4e8e\/etc\/nginx\/sites-available\/\u76ee\u5f55\u4e0b&#xff0c;\u9ed8\u8ba4\u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6\u4e3adefault\u3002<\/li>\n<li>\u65e5\u5fd7\u6587\u4ef6&#xff1a;\u4f4d\u4e8e\/var\/log\/nginx\/\u76ee\u5f55\u4e0b\u7684access.log\u548cerror.log\u3002<\/li>\n<\/ul>\n<p>7.\u4ee3\u7406\u672c\u5730\u6a21\u5757\u670d\u52a1<\/p>\n<p>\u672c\u5730\u5730\u5740&#xff1a;http:\/\/192.168.1.22:8010\/realtalk\/examples\/index.html<\/p>\n<p>\u76ee\u6807\u5730\u5740&#xff1a;https:\/\/192.168.1.22:7010\/realtalk\/examples\/index.html<\/p>\n<p>\u7f16\u5199nginx\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>nano \/etc\/nginx\/sites-available\/default<\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\n    listen <span class=\"token number\">7010<\/span> ssl<span class=\"token punctuation\">;<\/span><br \/>\n    server_name <span class=\"token number\">192.168<\/span>.1.22<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\"># SSL \u8bc1\u4e66\u914d\u7f6e<\/span><br \/>\n    ssl_certificate \/etc\/nginx\/ssl\/certificate.crt<span class=\"token punctuation\">;<\/span><br \/>\n    ssl_certificate_key \/etc\/nginx\/ssl\/private_unencrypted.key<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\"># SSL \u534f\u8bae\u4e0e\u5bc6\u7801\u5957\u4ef6<\/span><br \/>\n    ssl_protocols TLSv1.2 TLSv1.3<span class=\"token punctuation\">;<\/span><br \/>\n    ssl_ciphers HIGH:<span class=\"token operator\">!<\/span>aNULL:<span class=\"token operator\">!<\/span>MD5<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\"># \u9759\u6001\u8d44\u6e90\u914d\u7f6e<\/span><br \/>\n    location \/realtalk\/examples\/ <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token builtin class-name\">alias<\/span> \/mnt\/e\/work\/metahuman-stream\/web\/realtalk\/examples\/<span class=\"token punctuation\">;<\/span><br \/>\n        index index.html<span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u5904\u7406\u9759\u6001\u6587\u4ef6\u7684\u7f13\u5b58\u63a7\u5236&#xff0c;\u786e\u4fdd\u52a0\u8f7d\u6700\u65b0\u8d44\u6e90<\/span><br \/>\n        add_header Cache-Control <span class=\"token string\">&#034;no-cache, no-store, must-revalidate&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header Pragma <span class=\"token string\">&#034;no-cache&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header Expires <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u542f\u7528\u76ee\u5f55\u5217\u8868&#xff08;\u53ef\u9009&#xff0c;\u65b9\u4fbf\u8c03\u8bd5&#xff09;<\/span><br \/>\n        autoindex on<span class=\"token punctuation\">;<\/span><br \/>\n        autoindex_exact_size off<span class=\"token punctuation\">;<\/span><br \/>\n        autoindex_localtime on<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\"># \u65b0\u589e\u4ee3\u7406\u8def\u5f84<\/span><br \/>\n    location \/client.js <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/192.168.1.22:8010\/client.js<span class=\"token punctuation\">;<\/span> <span class=\"token comment\"># \u5c06 HTTPS \u8bf7\u6c42\u8f6c\u53d1\u5230 HTTP \u670d\u52a1<\/span><br \/>\n        proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token comment\"># \u4ee3\u7406 \/webrtcapi.html \u5230 8010<\/span><br \/>\n    location \/webrtcapi.html <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/192.168.1.22:8010\/webrtcapi.html<span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span>    <\/p>\n<p>    <span class=\"token comment\"># \u65b0\u589e\u4ee3\u7406 \/qwener \u5230 8010\/qwener<\/span><br \/>\n    location \/qwener <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/192.168.1.22:8010\/qwener<span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u53ef\u9009&#xff1a;\u6dfb\u52a0\u7f13\u5b58\u63a7\u5236\u5934&#xff08;\u5982\u679c\u9700\u8981\u63a7\u5236\u7f13\u5b58&#xff09;<\/span><br \/>\n        add_header Cache-Control <span class=\"token string\">&#034;no-cache, no-store, must-revalidate&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header Pragma <span class=\"token string\">&#034;no-cache&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header Expires <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\"># API \u8bf7\u6c42\u4ee3\u7406\u914d\u7f6e<\/span><br \/>\n    location \/api\/ <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/127.0.0.1:8010<span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u8de8\u57df\u8bbe\u7f6e<\/span><br \/>\n        add_header Access-Control-Allow-Origin *<span class=\"token punctuation\">;<\/span><br \/>\n        add_header Access-Control-Allow-Methods <span class=\"token string\">&#034;GET, POST, OPTIONS&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header Access-Control-Allow-Headers <span class=\"token string\">&#034;Authorization, Content-Type&#034;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u5904\u7406\u9884\u68c0\u8bf7\u6c42 (CORS)<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token variable\">$request_method<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;OPTIONS&#039;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Access-Control-Allow-Origin&#039;<\/span> <span class=\"token string\">&#039;*&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Access-Control-Allow-Methods&#039;<\/span> <span class=\"token string\">&#039;GET, POST, OPTIONS&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Access-Control-Allow-Headers&#039;<\/span> <span class=\"token string\">&#039;Authorization, Content-Type&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Access-Control-Max-Age&#039;<\/span> <span class=\"token number\">1728000<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Content-Type&#039;<\/span> <span class=\"token string\">&#039;text\/plain charset&#061;UTF-8&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header <span class=\"token string\">&#039;Content-Length&#039;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token builtin class-name\">return<\/span> <span class=\"token number\">204<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\"># WebSocket \u8bf7\u6c42\u4ee3\u7406<\/span><br \/>\n    location \/ws\/ <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/127.0.0.1:8010<span class=\"token punctuation\">;<\/span><br \/>\n        proxy_http_version <span class=\"token number\">1.1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Upgrade <span class=\"token variable\">$http_upgrade<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Connection <span class=\"token string\">&#034;upgrade&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\"># \u4e3b\u7ad9\u70b9\u4ee3\u7406&#xff0c;\u7528\u4e8e\u5176\u4ed6\u672a\u660e\u786e\u5339\u914d\u7684\u8def\u5f84<\/span><br \/>\n    location \/ <span class=\"token punctuation\">{<\/span><br \/>\n        proxy_pass http:\/\/127.0.0.1:8010<span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header X-Forwarded-Proto <span class=\"token variable\">$scheme<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\"># \u9632\u6b62 WebSocket \u6216\u957f\u8fde\u63a5\u88ab\u5207\u65ad<\/span><br \/>\n        proxy_http_version <span class=\"token number\">1.1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Upgrade <span class=\"token variable\">$http_upgrade<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        proxy_set_header Connection <span class=\"token string\">&#034;upgrade&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># HTTP \u914d\u7f6e&#xff08;\u91cd\u5b9a\u5411\u81f3 HTTPS&#xff09;<\/span><br \/>\nserver <span class=\"token punctuation\">{<\/span><br \/>\n    listen <span class=\"token number\">80<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    server_name <span class=\"token number\">192.168<\/span>.1.22<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\"># \u5c06\u6240\u6709 HTTP \u8bf7\u6c42\u5f3a\u5236\u91cd\u5b9a\u5411\u5230 HTTPS<\/span><br \/>\n    <span class=\"token builtin class-name\">return<\/span> <span class=\"token number\">301<\/span> https:\/\/<span class=\"token variable\">$host<\/span><span class=\"token variable\">$request_uri<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e09\u3001\u66f4\u6539\u4e0b\u9762\u51e0\u4e2a\u6587\u4ef6\u4ee3\u7801&#xff08;\u6539\u6210\u4f60\u672c\u5730\u7684&#xff09;<\/p>\n<p>E:\\\\work\\\\metahuman-stream\\\\web\\\\realtalk\\\\examples\\\\index.html<\/p>\n<p>https:\/\/192.168.1.22:7010\/webrtcapi.html<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231915-6802ddf319408.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> E:\\\\work\\\\metahuman-stream\\\\web\\\\realtalk\\\\examples\\\\index_noauto.js<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231915-6802ddf354b9c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u56db\u3001\u6d4b\u8bd5<\/p>\n<p>\u624b\u673a\u8bbe\u5907\u4f7f\u7528\u8c37\u6b4c\u3001\u706b\u72d0\u3001edge\u6d4f\u89c8\u5668\u6d4b\u8bd5\u8f93\u5165\u8bbf\u95ee\u6d4b\u8bd5 https:\/\/192.168.1.22:7010\/realtalk\/examples\/index.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb932\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf18\u6b21\u3002WSL2Nginx\u3002<\/p>\n","protected":false},"author":2,"featured_media":23274,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1779,151,622,117,103,1101,43],"topic":[],"class_list":["post-23281","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-aispherebutler","tag-http","tag-https","tag-nginx","tag-ubuntu","tag-ai-sphere-butler","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/23281.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb932\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf18\u6b21\u3002WSL2Nginx\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/23281.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T23:19:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf249194.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23281.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/23281.html\",\"name\":\"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T23:19:16+00:00\",\"dateModified\":\"2025-04-18T23:19:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/23281.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/23281.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23281.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/23281.html","og_locale":"zh_CN","og_type":"article","og_title":"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb932\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf18\u6b21\u3002WSL2Nginx\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/23281.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T23:19:16+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418231914-6802ddf249194.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/23281.html","url":"https:\/\/www.wsisp.com\/helps\/23281.html","name":"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T23:19:16+00:00","dateModified":"2025-04-18T23:19:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/23281.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/23281.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/23281.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"AI-Sphere-Butler\u4e4bUbuntu\u670d\u52a1\u5668\u5982\u4f55\u90e8\u7f72Nginx\u4ee3\u7406\uff0c\u5e76\u5c06HTTP\u5347\u7ea7\u6210HTTPS\uff0c\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=23281"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23281\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/23274"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=23281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=23281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=23281"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=23281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}