{"id":205,"date":"2025-01-22T07:40:14","date_gmt":"2025-01-21T23:40:14","guid":{"rendered":"https:\/\/simon.ice.com.tw\/?p=205"},"modified":"2026-05-13T17:45:15","modified_gmt":"2026-05-13T09:45:15","slug":"dehydrate-nginx-%e6%86%91%e8%ad%89%e7%94%b3%e8%ab%8b%e5%8f%8a%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/simon.ice.com.tw\/?p=205","title":{"rendered":"ipfire \u7684\u90a3\u4e9b\u4e8b\u5152"},"content":{"rendered":"\n<pre class=\"wp-block-code has-small-font-size\"><code><strong>$ mkdir \/etc\/nginx\/conf.d<\/strong>\n<strong>$ nano \/etc\/nginx\/nginx.conf<\/strong>\n  \u52a0\u4e0a #\u542b\u62ec\u5176\u4ed6conf\u8a2d\u5b9a\u6a94\n        include \/etc\/nginx\/conf.d\/*.conf;\n       #\u4e0a\u50b3\u6a94\u6848\u7121\u9650\u5236\n        client_max_body_size 0;\n       #asp.net core \u9700\u8981\n         map $http_upgrade $connection_upgrade {\n        default upgrade;\n        ''      close;\n\n\u5efa\u7acbdehydrated\u8a2d\u5b9a\u6a94\n<strong>$ echo \"WELLKNOWN=\/var\/www\/dehydrated\" > \/etc\/dehydrated\/config \n$ mkdir -p \/var\/www\/dehydrated<\/strong>\n\n<strong>$ nano \/etc\/nginx\/conf.d\/http.conf<\/strong>\n<code>server {\n  listen 80;\n\n  #Dehydrated \u53d6\u5f97\u6191\u8b49\n  location \/.well-known\/acme-challenge\/ {\n        alias \/var\/www\/dehydrated\/;\n  }\n\n  location \/ {\n            proxy_pass http:\/\/192.168.70.60:80;\n            proxy_set_header Host $host;\n            proxy_set_header X-Real-IP $remote_addr;\n        }\n\n  # listen on the www host\n  #server_name simon.ice.com.tw;\n\n  #and redirect to the non-www host (declared below)\n  #return 301 https:\/\/old.ice.com.tw$request_uri;\n}<\/code>\u6aa2\u67e5\u4e26\u5957\u7528nginx\u8a2d\u5b9a\u751f\u6548\n<strong>$ <\/strong>nginx -t\n<strong>$ <\/strong>nginx -s reload\n\n\u63a5\u4e0b\u4f86\u7de8\u8f2f\n<strong>$ nano \/etc\/dehydrated\/domains.txt<\/strong>\n\n\u7b2c\u4e00\u6b21\u4f7f\u7528\u8981\u5148\u540c\u610f\u8072\u660e\uff0c\u5148\u8f38\u5165\n<strong>$ <\/strong>dehydrated --register --accept-terms\n\u8a18\u5f97\u5148\u95dc\u6389 nat\n<strong>$ <\/strong>dehydrated -c<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-yellow-background-color has-text-color has-background has-link-color wp-elements-9050e3823adf63fe18dc34f4a4c8bbf8\"><strong>\u8a2d\u5b9aproxmox \u53cd\u5411\u4ee3\u7406<\/strong>\n<strong>$ <\/strong>nano \/etc\/nginx\/conf.d\/proxmox.conf\nserver {\n        listen 8006 ssl;\n        server_name 64.ice.com.tw;\n\n        ssl_certificate \/etc\/dehydrated\/certs\/64.ice.com.tw\/cert.pem;\n        ssl_certificate_key \/etc\/dehydrated\/certs\/64.ice.com.tw\/privkey.pem;\n\n        location \/ {\n          proxy_pass https:\/\/192.168.1.95:8006;\n          proxy_buffering off;\n          client_max_body_size 0;\n          proxy_connect_timeout 3600s;\n          proxy_read_timeout 3600s;\n          proxy_send_timeout 3600s;\n          send_timeout 3600s;\n\n        # Important for WebSocket\/Console access\n          proxy_http_version 1.1;\n          proxy_set_header Upgrade $http_upgrade;\n          proxy_set_header Connection \"upgrade\";\n          proxy_set_header Host $host;\n          proxy_set_header X-Forwarded-Proto $scheme;\n        }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/blog.niclin.tw\/2018\/08\/04\/%E8%AE%93%E7%B6%B2%E7%AB%99%E5%85%8D%E8%B2%BB%E6%93%81%E6%9C%89-https-%E6%86%91%E8%AD%89%E7%94%B3%E8%AB%8B-lets-encrypt-%E4%B8%A6%E8%87%AA%E5%8B%95%E6%9B%B4%E6%96%B0\/\" target=\"_blank\" rel=\"noreferrer noopener\">Dehydrate + Nginx \u6191\u8b49\u7533\u8acb\u53ca\u53cd\u5411\u4ee3\u7406<\/a><br><a href=\"https:\/\/docsaid.org\/docs\/nginx-notes\/https-settings\/\" data-type=\"link\" data-id=\"https:\/\/docsaid.org\/docs\/nginx-notes\/https-settings\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx HTTPS \u8a2d\u5b9a<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8a2d\u5b9aproxmox \u53cd\u5411\u4ee3\u7406  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-205","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=205"}],"version-history":[{"count":17,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":266,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/205\/revisions\/266"}],"wp:attachment":[{"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simon.ice.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}