{"id":45541,"date":"2020-03-02T20:59:03","date_gmt":"2020-03-02T12:59:03","guid":{"rendered":"http:\/\/4563.org\/?p=45541"},"modified":"2020-03-02T20:59:03","modified_gmt":"2020-03-02T12:59:03","slug":"%e7%94%b2%e9%aa%a8%e6%96%87centos7-nginx%e5%8f%8d%e4%bb%a3ccaa2-0%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=45541","title":{"rendered":"\u7532\u9aa8\u6587centos7 nginx\u53cd\u4ee3ccaa2.0\u7684\u95ee\u9898"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>pydos<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u7532\u9aa8\u6587centos7 nginx\u53cd\u4ee3ccaa2.0\u7684\u95ee\u9898<\/h3>\n<p>  \t\t\u7532\u9aa8\u6587\u539f\u88c5centos7\u7cfb\u7edf\u5b89\u88c5\u7684ccaa2.0<br \/>  https:\/\/www.hostloc.com\/forum.php?mod=viewthread&amp;tid=650479&amp;highlight=ccaa&amp;mobile=2<br \/>  yum install nginx\u5b89\u88c5\u76841.16\u7248<br \/>  nginx\u914d\u7f6e\u6587\u4ef6\u53cd\u4ee3\u7532\u9aa8\u6587\u7684127.0.0.1:6080\u523080\u7aef\u53e3\u53cd\u4ee3\u4e0d\u4e86\uff0c\u4e0d\u77e5\u9053\u662f\u54ea\u91cc\u7684\u95ee\u9898\uff0c\u9632\u706b\u5899\u90fd\u5173\u95ed\u4e86\u3002<br \/>  \u9ebb\u70e6\u5927\u4f6c\u5e2e\u770b\u770b\u914d\u7f6e\u6587\u4ef6\u54ea\u91cc\u4e0d\u5bf9<br \/>  \uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e\uff5e<br \/>  # For more information on configuration, see:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;#&nbsp; &nbsp;* Official English Documentation: http:\/\/nginx.org\/en\/docs\/<br \/>  #&nbsp; &nbsp;* Official Russian Documentation: http:\/\/nginx.org\/ru\/docs\/<\/p>\n<p>  user nginx;<br \/>  worker_processes auto;<br \/>  error_log \/var\/log\/nginx\/error.log;<br \/>  pid \/run\/nginx.pid;<br \/>  # For more information on configuration, see:<br \/>  #&nbsp; &nbsp;* Official English Documentation: http:\/\/nginx.org\/en\/docs\/<br \/>  #&nbsp; &nbsp;* Official Russian Documentation: http:\/\/nginx.org\/ru\/docs\/<br \/>  worker_processes auto;<br \/>  error_log \/var\/log\/nginx\/error.log;<br \/>  pid \/run\/nginx.pid;<\/p>\n<p>  # Load dynamic modules. See \/usr\/share\/doc\/nginx\/README.dynamic.<br \/>  include \/usr\/share\/nginx\/modules\/*.conf;<br \/>  events {<br \/>  &nbsp; &nbsp; worker_connections 1024;<br \/>  }<\/p>\n<p>  http {<br \/>  &nbsp; &nbsp; log_formatmain&#8217;$remote_addr &#8211; $remote_user [$time_local] &quot;$request&quot; &#8216;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &#8216;$status $body_bytes_sent &quot;$http_referer&quot; &#8216;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &#8216;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#8217;;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <br \/>  &nbsp; &nbsp; access_log\/var\/log\/nginx\/access.logmain;<\/p>\n<p>  &nbsp; &nbsp; sendfile&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;on;<br \/>  &nbsp; &nbsp; tcp_nopush&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; on;<br \/>  &nbsp; &nbsp; tcp_nodelay&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;on;<br \/>  &nbsp; &nbsp; keepalive_timeout&nbsp; &nbsp;65;<br \/>  &nbsp; &nbsp; types_hash_max_size 2048;<\/p>\n<p>  &nbsp; &nbsp; include&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; \/etc\/nginx\/mime.types;<br \/>  &nbsp; &nbsp; default_type&nbsp; &nbsp;&nbsp; &nbsp;application\/octet-stream;<\/p>\n<p>  &nbsp; &nbsp; # Load modular configuration files from the \/etc\/nginx\/conf.d directory.<br \/>  &nbsp; &nbsp; # See http:\/\/nginx.org\/en\/docs\/ngx_core_module.html#include<br \/>  &nbsp; &nbsp; # for more information.&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;include \/etc\/nginx\/conf.d\/*.conf;<\/p>\n<p>  &nbsp; &nbsp; server {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;listen&nbsp; &nbsp;&nbsp; &nbsp; 8000;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;server_name123.456.789.000;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#root&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;\/usr\/share\/nginx\/html;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;#return 301 http:\/\/520206.xyz$request_uri;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;# Load configuration files for the default server block.<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;include \/etc\/nginx\/default.d\/*.conf;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;location~* .(php|jsp|cgi|asp|aspx)$<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_pass http:\/\/127.0.0.1:6080;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Host $host;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Real-IP $remote_addr;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header REMOTE-HOST $remote_addr;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;location \/<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;{<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_pass http:\/\/127.0.0.1:6080;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header Host $host;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Real-IP $remote_addr;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;proxy_set_header REMOTE-HOST $remote_addr;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;add_header X-Cache $upstream_cache_status;<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;#Set Nginx Cache<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; add_header Cache-Control no-cache;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;expires 12h;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;error_page 404 \/404.html;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;location = \/40x.html {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;error_page 500 502 503 504 \/50x.html;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;location = \/50x.html {<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  &nbsp; &nbsp; }<\/p>\n<p>  # Settings for a TLS enabled server.<br \/>  #<br \/>  #&nbsp; &nbsp; server {<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;listen&nbsp; &nbsp;&nbsp; &nbsp; 443 ssl http2 default_server;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;listen&nbsp; &nbsp;&nbsp; &nbsp; [::]:443 ssl http2 default_server;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;server_name_;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;root&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;\/usr\/share\/nginx\/html;<br \/>  #<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_certificate &quot;\/etc\/pki\/nginx\/server.crt&quot;;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_certificate_key &quot;\/etc\/pki\/nginx\/private\/server.key&quot;;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_session_cache shared:SSL:1m;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_session_timeout10m;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_ciphers HIGH:!aNULL:!MD5;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;ssl_prefer_server_ciphers on;<br \/>  #<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;# Load configuration files for the default server block.<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;include \/etc\/nginx\/default.d\/*.conf;<br \/>  #<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;location \/ {<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  #<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;error_page 404 \/404.html;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;location = \/40x.html {<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  #<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;error_page 500 502 503 504 \/50x.html;<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;location = \/50x.html {<br \/>  #&nbsp; &nbsp;&nbsp; &nbsp;}<br \/>  #&nbsp; &nbsp; }<\/p>\n<p>  }\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>pydos \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u7532\u9aa8\u6587&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/45541"}],"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=45541"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/45541\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45541"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}