{"id":187,"date":"2024-02-24T16:55:50","date_gmt":"2024-02-24T08:55:50","guid":{"rendered":"https:\/\/669082.xyz\/?p=187"},"modified":"2024-02-24T16:55:50","modified_gmt":"2024-02-24T08:55:50","slug":"nginx%e6%89%8b%e5%8a%a8%e9%85%8d%e7%bd%aessl%e5%8f%8a-http%e5%8f%8d%e4%bb%a3%e5%92%8cwss%e5%8f%8d%e4%bb%a3%e5%8f%82%e8%80%83","status":"publish","type":"post","link":"https:\/\/669082.xyz\/index.php\/2024\/02\/24\/nginx%e6%89%8b%e5%8a%a8%e9%85%8d%e7%bd%aessl%e5%8f%8a-http%e5%8f%8d%e4%bb%a3%e5%92%8cwss%e5%8f%8d%e4%bb%a3%e5%8f%82%e8%80%83\/","title":{"rendered":"nginx\u624b\u52a8\u914d\u7f6essl\u53ca http\u53cd\u4ee3\u548cwss\u53cd\u4ee3\u53c2\u8003"},"content":{"rendered":"<pre><code class=\"language-shell\">server {\n  listen 443 ssl http2;\n  server_name domain.com;\n  ssl_certificate \/www\/server\/web_conf\/ssl\/domain.com\/fullchain.pem;\n  ssl_certificate_key \/www\/server\/web_conf\/ssl\/domain.com\/privkey.pem;\n  ssl_session_timeout 5m;\n  ssl_protocols TLSv1.2 TLSv1.3;\n  ssl_prefer_server_ciphers on;\n  ssl_ciphers HIGH:!aNULL:!MD5;\n  ssl_session_cache builtin:1000 shared:SSL:10m;\n\n  # Allow large attachments\n  client_max_body_size 256M;\n\n  #http\u53cd\u4ee3\n  location \/ {\n    # \u9700\u8981\u4ee3\u7406\u7684\u5bb9\u5668ip\u6216\u5bb9\u5668\u522b\u540d\n    # http\u672c\u5730\u7aef\u53e3\u9ed8\u8ba4\u662f 9501\uff0c\n    proxy_pass http:\/\/127.0.0.1:9501\/;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection keep-alive;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n    proxy_cache_bypass $http_upgrade;\n\n}\n\n  #wss\u53cd\u4ee3\n  location \/api\/command {\n        proxy_redirect off;\n        proxy_pass http:\/\/127.0.0.1:9501\/api\/command\/; #\u8f6c\u53d1\u5230\u4f60\u672c\u5730\u7684 9501 \u7aef\u53e3 \u5bf9\u5e94 ws \u7684\u7aef\u53e3\n        proxy_set_header Host $host;\n        proxy_set_header X-Real_IP $remote_addr;\n        proxy_set_header X-Forwarded-For $remote_addr:$remote_port;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection upgrade;\n    }\n  access_log \/www\/wwwlogs\/domain.com.log;\n  error_log   \/www\/wwwlogs\/domain.com.error.log;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>server { listen 443 ssl http2; server_name domain. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-187","post","type-post","status-publish","format-standard","hentry","category-nginx"],"_links":{"self":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":1,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/187\/revisions\/188"}],"wp:attachment":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}