{"id":544,"date":"2022-06-20T08:51:07","date_gmt":"2022-06-20T00:51:07","guid":{"rendered":"http:\/\/blog.nonot.cn\/?p=544"},"modified":"2024-07-08T12:49:35","modified_gmt":"2024-07-08T04:49:35","slug":"nginx%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%90%8e%e9%87%8d%e6%96%b0%e5%8a%a0%e8%bd%bd%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6nginx","status":"publish","type":"post","link":"https:\/\/blog.nonot.cn\/index.php\/2022\/06\/20\/nginx%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%90%8e%e9%87%8d%e6%96%b0%e5%8a%a0%e8%bd%bd%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6nginx\/","title":{"rendered":"nginx\u914d\u7f6e\u6587\u4ef6\uff0c\u4fee\u6539\u540e\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6nginx"},"content":{"rendered":"<p>1.\u5f00\u59cbnginx<\/p>\n<p>\u5207\u6362\u5230\u76f8\u5e94\u8def\u5f84<\/p>\n<p>start nginx.exe<\/p>\n<p>2.\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>nginx -s reload<\/p>\n<p>3.\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre class=\"lang:default decode:true  \">#user  nobody;\nworker_processes  1;\n\n#error_log  logs\/error.log;\n#error_log  logs\/error.log  notice;\n#error_log  logs\/error.log  info;\n\n#pid        logs\/nginx.pid;\n\n\nevents {\n    worker_connections  1024;\n}\n\n\nhttp {\n    include       mime.types;\n    default_type  application\/octet-stream;\n\n    #log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\n    #                  '$status $body_bytes_sent \"$http_referer\" '\n    #                  '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n    #access_log  logs\/access.log  main;\n\n    sendfile        on;\n    #tcp_nopush     on;\n\n    #keepalive_timeout  0;\n    keepalive_timeout  65;\n\u3000\u3000# ip\u8bf7\u6c42\u9650\u5236\u3000\u3000limit_req_zone $binary_remote_addr zone=seckill:10m rate1r\/s;\n    #gzip  on;\n\n    upstream testaddress {\n        server localhost:5788 weight=1;\n        server localhost:5789 weight=1;\n        server localhost:5787 weight=1;\n    }\n    server {\n        listen       10060;\n        server_name  localhost;\n\n        #charset koi8-r;\n\n        #access_log  logs\/host.access.log  main;\n\n        location \/ {\n            proxy_pass http:\/\/testaddress;\n            root   html;\n            index  index.html index.htm;\u3000\u3000\u3000\u3000\u3000\u3000\u3000limit_req zone=seckill;\n        }\n\n        #error_page  404              \/404.html;\n\n        # redirect server error pages to the static page \/50x.html\n        #\n        error_page   500 502 503 504  \/50x.html;\n        location = \/50x.html {\n            root   html;\n        }\n\n        # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n        #\n        #location ~ \\.php$ {\n        #    proxy_pass   http:\/\/127.0.0.1;\n        #}\n\n        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n        #\n        #location ~ \\.php$ {\n        #    root           html;\n        #    fastcgi_pass   127.0.0.1:9000;\n        #    fastcgi_index  index.php;\n        #    fastcgi_param  SCRIPT_FILENAME  \/scripts$fastcgi_script_name;\n        #    include        fastcgi_params;\n        #}\n\n        # deny access to .htaccess files, if Apache's document root\n        # concurs with nginx's one\n        #\n        #location ~ \/\\.ht {\n        #    deny  all;\n        #}\n    }\n\n\n    # another virtual host using mix of IP-, name-, and port-based configuration\n    #\n    #server {\n    #    listen       8000;\n    #    listen       somename:8080;\n    #    server_name  somename  alias  another.alias;\n\n    #    location \/ {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n\n\n    # HTTPS server\n    #\n    #server {\n    #    listen       443 ssl;\n    #    server_name  localhost;\n\n    #    ssl_certificate      cert.pem;\n    #    ssl_certificate_key  cert.key;\n\n    #    ssl_session_cache    shared:SSL:1m;\n    #    ssl_session_timeout  5m;\n\n    #    ssl_ciphers  HIGH:!aNULL:!MD5;\n    #    ssl_prefer_server_ciphers  on;\n\n    #    location \/ {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n\n}<\/pre>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5f00\u59cbnginx \u5207\u6362\u5230\u76f8\u5e94\u8def\u5f84 start nginx.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-nginx"],"_links":{"self":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":1,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":1201,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/544\/revisions\/1201"}],"wp:attachment":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}