{"id":567148,"date":"2023-09-17T16:07:23","date_gmt":"2023-09-17T08:07:23","guid":{"rendered":"http:\/\/4563.org\/?p=567148"},"modified":"2023-09-17T16:07:23","modified_gmt":"2023-09-17T08:07:23","slug":"%e6%b1%82%e5%8a%a9nginx%e9%ab%98%e6%89%8b-%e4%b8%89%e6%af%9b%e5%ae%b6vps%e6%97%a0%e6%b3%95%e5%8f%8d%e4%bb%a3google%e5%85%b6%e4%bb%96%e5%9f%9f%e5%90%8d-%e4%b8%bb%e5%9f%9f%e5%90%8d%e5%8f%af%e4%bb%a5","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=567148","title":{"rendered":"\u6c42\u52a9nginx\u9ad8\u624b \u4e09\u6bdb\u5bb6vps\u65e0\u6cd5\u53cd\u4ee3google\u5176\u4ed6\u57df\u540d \u4e3b\u57df\u540d\u53ef\u4ee5"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>v2ex\u7ad9\u957f\u5c0f\u5fc3\u773c<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u6c42\u52a9nginx\u9ad8\u624b \u4e09\u6bdb\u5bb6vps\u65e0\u6cd5\u53cd\u4ee3google\u5176\u4ed6\u57df\u540d \u4e3b\u57df\u540d\u53ef\u4ee5<\/h3>\n<p>  \t\t\/etc\/nginx\/nginx.conf\u662f\u9ed8\u8ba4\u7684\u6ca1\u52a8\uff1a<br \/>  user www-data;<br \/>  worker_processes 1;<br \/>  pid \/run\/nginx.pid;<br \/>  worker_rlimit_nofile 65536;<br \/>  events {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; worker_connections 7680;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # multi_accept on;<br \/>  }<\/p>\n<p>  http {<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # Basic Settings<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ##<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; sendfile on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; tcp_nopush on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; tcp_nodelay on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; keepalive_timeout 0;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; types_hash_max_size 2048;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # server_tokens off;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; # server_names_hash_bucket_size 64;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # server_name_in_redirect off;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; include \/etc\/nginx\/mime.types;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; default_type application\/octet-stream;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # SSL Settings<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ##<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ssl_prefer_server_ciphers on;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # Logging Settings<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  log_formatmain&#8217;$remote_addr [$time_local] $status ($body_bytes_sent) &quot;$host&quot; &quot;$request&quot; &#8216;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&#8216;$upstream_addr&#8217; ;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # Gzip Settings<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ##<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; gzip on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; gzip_disable &quot;msie6&quot;;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_vary on;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_proxied any;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_comp_level 6;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_buffers 16 8k;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_http_version 1.1;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # gzip_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; ##<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; # Virtual Host Configs<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; ##<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; include \/etc\/nginx\/conf.d\/*.conf;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; include \/etc\/nginx\/sites-enabled\/*;<br \/>  }<\/p>\n<p>  \u4ecesites-enabled\u5bfc\u5165123.conf<br \/>  server{<br \/>  listen *:1234;<\/p>\n<p>  access_log \/var\/log\/nginx\/access.log main;<br \/>  error_log \/dev\/null;<\/p>\n<p>  location \/ {<\/p>\n<p>  proxy_http_version 1.1;<br \/>  proxy_set_header Connection &quot;&quot;;<\/p>\n<p>  proxy_set_header Host $http_host;<br \/>  proxy_set_header Accept-Encoding &quot;gzip, deflate&quot;;<\/p>\n<p>  proxy_pass https:\/\/$http_host$request_uri;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  }<\/p>\n<p>  \u6211\u8fd9\u8fb9\u53d1\u9001http\uff08\u975ehttps\uff09\u53cd\u4ee3\u8bf7\u6c42\u5230\u6211\u7684vps:1234\uff0c \u51fa\u73b0\u4e86\u8be1\u5f02\u7684\u4e00\u5e55\uff1a<br \/>  \u5982\u679chost\u662fwww.google.com\u5c31\u53ef\u4ee5\u6b63\u5e38200<br \/>  \u5982\u679chost\u662fwww.google.com.hk\u6216\u8005\u5176\u4ed6\u4efb\u4f55\u56fd\u540d\uff0c \u5c31\u51fa\u73b0\u4e86499 \u9519\u8bef\u3002 <\/p>\n<p>  \u53e6\u5916\u628a\u8fd92\u4e2a\u914d\u7f6e\u6587\u4ef6\u653e\u5728OVH\u6216\u8005\u5176\u4ed6\u7f8e\u56fdvps\u4e0a\u4e5f\u5168\u90e8\u6b63\u5e38\u3002 \u53ea\u6709\u4e09\u6bdb\u5bb6\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>v2ex\u7ad9\u957f\u5c0f\u5fc3\u773c \u5927\u4f6c\u6709\u8bdd\u8bf4 :&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/567148"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=567148"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/567148\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=567148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=567148"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=567148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}