{"id":135451,"date":"2019-02-03T09:33:24","date_gmt":"2019-02-03T01:33:24","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=135451"},"modified":"2019-01-30T09:34:12","modified_gmt":"2019-01-30T01:34:12","slug":"nginx-9000-forward-80","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/nginx-9000-forward-80.html","title":{"rendered":"\u5982\u4f55\u7528nginx\u5728\u672c\u5730\u628a9000\u7aef\u53e3\u8f6c\u53d1\u523080\u7aef\u53e3\u4e0a"},"content":{"rendered":"
\n
\n\n\n\n
\u5bfc\u8bfb<\/td>\n\u8d77\u56e0\u770b\u5230\u4e00\u4e2a\u7528java\u5199\u7684\u8f7b\u535a\u5ba2\uff0c\u4e8e\u662f\u5c31\u5174\u81f4\u51b2\u51b2\u7684\u8bd5\u7528\u4e00\u4e0b\u3002\u7531\u4e8e\u662flnmp\u7684\u73af\u5883\uff0cNginx\u5360\u7528\u4e8680\u7aef\u53e3\uff0c\u65b0\u535a\u5ba2\u53ea\u80fd\u7528\u5176\u4ed6\u7684\u7aef\u53e3\uff0c\u8fd9\u91cc\u9009\u62e9\u4e869000\u7aef\u53e3\uff0c\u672c\u5730\u6d4b\u8bd5\u6ca1\u95ee\u9898\u3002\u603b\u4e0d\u80fd\u8bbf\u95ee\u4e86\u57df\u540d\u7136\u540e\u5728\u52a0\u4e0a\u7aef\u53e3\u53f7\u5427\u3002\u4e8e\u662f\u5c31\u60f3\u7740\u7528Nginx\u6765\u53cd\u5411\u4ee3\u7406\u672c\u5730\u76849000\u7aef\u53e3<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n<\/div>\n

\u914d\u7f6e<\/strong><\/div>\n

\u65b0\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6<\/p>\n

vim www.ti3.cc.conf<\/pre>\n

\u8f93\u5165\u4ee5\u4e0b\u914d\u7f6e<\/p>\n

listen 80;\r\nserver_name localhost www.ti3.cc ti3.cc;\r\nlocation \/ {\r\nproxy_pass http:\/\/localhost:9000;\r\nproxy_redirect default;\r\n}\r\n}\r\n<\/pre>\n

wq \u4fdd\u5b58,\u91cd\u8f7dNginx<\/p>\n

service nginx reload<\/pre>\n

\u7ed3\u679c\u6539\u8fdb\u7248:
\n\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff08\u4ee5www.ti3.cc\u4e3a\u4f8b\uff09<\/p>\n

vim www.ti3.cc.conf<\/pre>\n

\u8f93\u5165\u4e00\u4e0b\u914d\u7f6e<\/p>\n

server\r\n{\r\n\r\nlisten 80;\r\nserver_name www.ti3.cc;\r\n\r\nlocation \/\r\n{\r\nproxy_redirect off;\r\nproxy_set_header Host $host;\r\nproxy_set_header X-Real-IP $remote_addr;\r\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\nproxy_pass http:\/\/localhost:9000;\r\n}\r\n\r\nlocation ~ .*\\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$\r\n{\r\nproxy_set_header Host $host;\r\nproxy_set_header X-Forwarded-For $remote_addr;\r\nproxy_pass http:\/\/localhost:9000;\r\n\r\n}\r\n\r\naccess_log \/www\/wwwlogs\/ti3.cc.log;\r\n}\r\n<\/pre>\n

wq\u4fdd\u5b58<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\u65b0\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6 vim www.ti3.cc.conf \u8f93\u5165\u4ee5\u4e0b\u914d\u7f6e listen 80; server_n […]<\/p>\n","protected":false},"author":362,"featured_media":135458,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-135451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=135451"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135451\/revisions"}],"predecessor-version":[{"id":135492,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135451\/revisions\/135492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/135458"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=135451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=135451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=135451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}