{"id":1408,"date":"2024-04-13T23:51:42","date_gmt":"2024-04-13T15:51:42","guid":{"rendered":"https:\/\/hkc.nasclub.vip\/?p=1408"},"modified":"2024-04-13T23:51:42","modified_gmt":"2024-04-13T15:51:42","slug":"%e7%be%a4%e6%99%96dsm%e5%8d%87%e7%ba%a77-2%e5%90%8eweb-station-nginx-%e4%bc%aa%e9%9d%99%e6%80%81%e5%a4%b1%e6%95%88","status":"publish","type":"post","link":"https:\/\/hkc.nasclub.vip\/?p=1408","title":{"rendered":"\u7fa4\u6656DSM\u5347\u7ea77.2\u540eWeb Station Nginx \u4f2a\u9759\u6001\u5931\u6548"},"content":{"rendered":"<p>\u5904\u7406\u8fc7\u7a0b<\/p>\n<p>ssh user@192.168.1.2 #\u7528\u6237\u540d@nas ip<\/p>\n<p>sudo -i #\u63d0\u5347\u6743\u9650<\/p>\n<p>cd \/usr\/local\/etc\/nginx\/conf.d<\/p>\n<p>ls- al<br \/>\n#\u67e5\u770b\u4ee5.service.\u5f00\u5934\u7684.conf\u6587\u4ef6<br \/>\n#\u5982\uff1a.service.0e4bca4b-5c28-4f70-84c6-b8db6bc3ebb0.493ebcac-4f10-47d7-8512-a26305aa64c8.conf<br \/>\ncat .service.0e4bca4b-5c28-4f70-84c6-b8db6bc3ebb0.493ebcac-4f10-47d7-8512-a26305aa64c8.conf<br \/>\n#\u786e\u5b9a\u662f\u8981\u914d\u7f6e\u4f2a\u9759\u6001\u7684web\uff0c\u8bb0\u4f4f\u6700\u540einclude\u5f15\u5165\u7684\u6587\u4ef6\u540d<\/p>\n<p>#\u793a\u4f8b\u6700\u540e\u4e00\u884c\uff1ainclude \/usr\/local\/etc\/nginx\/conf.d\/493ebcac-4f10-47d7-8512-a26305aa64c8\/user.conf*;<\/p>\n<p>#\u65b9\u6cd51<br \/>\n#\u5c06\u4e00\u4e2a\u4f2a\u9759\u6001\u901a\u7528\u6587\u4ef6\u4fdd\u5b58\u5230\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u5982\/volume1\/web\/nginx-conf\/thinkphp\/user.conf<br \/>\n#\u901a\u8fc7\u5728\u6587\u4ef6\u540e\u8ffd\u52a0include\u5b9e\u73b0\u7b80\u5355\u914d\u7f6e<br \/>\necho &#8221; include \/volume1\/web\/nginx-conf\/thinkphp\/user.conf*; &#8221; &gt;&gt; \/usr\/local\/etc\/nginx\/conf.d\/.service.0e4bca4b-5c28-4f70-84c6-b8db6bc3ebb0.493ebcac-4f10-47d7-8512-a26305aa64c8.conf<br \/>\n#\u8fd9\u6837\u5c31\u5f15\u5165\u4e86thinkphp\u5171\u7528\u7684\u4f2a\u9759\u6001\u6587\u4ef6\u4e86<br \/>\nnginx -s reload<br \/>\n#\u91cd\u542f\u5373\u53ef<\/p>\n<p>#\u65b9\u6cd52<br \/>\n#\u6700\u540e\u7684*\u4ee3\u8868\u5982\u679c\u6709\u8fd9\u4e2a\u6587\u4ef6\u5c31\u5f15\u5165\u8fd9\u4e2a\u6587\u4ef6\u5e76\u52a0\u8f7d\u5b83\uff0c\u90a3\u6211\u4eec\u5c31\u53bb\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\u5e76\u5199\u5165\u81ea\u5b9a\u4e49\u914d\u7f6e\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4f2a\u9759\u6001\u4e86<br \/>\nmkdir \/usr\/local\/etc\/nginx\/conf.d\/493ebcac-4f10-47d7-8512-a26305aa64c8\/<br \/>\nsudo vim \/usr\/local\/etc\/nginx\/conf.d\/493ebcac-4f10-47d7-8512-a26305aa64c8\/user.conf<br \/>\n# \u5199\u5165\u4f2a\u9759\u6001\u914d\u7f6e\u6216include \/volume1\/web\/nginx-conf\/xxx.xxx.xx\/user.conf*;<br \/>\n# \u76f4\u63a5\u5199\u5165\u4f2a\u9759\u6001\u914d\u7f6e\u6709\u5347\u7ea7\u540e\u4e22\u5931\u7684\u53ef\u80fd\u6027\uff1binclud\u8def\u5f84\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u653e\u5728\/volume\u91cc\u7684\u597d\u5904\u662f\u65b9\u4fbf\u7f16\u8f91\u5e76\u4e14\u5347\u7ea7\u4e0d\u4f1a\u4e22\u5931conf<br \/>\n# vim\u547d\u4ee4\uff1a:wq \u4fdd\u5b58<\/p>\n<p>nginx -s reload<br \/>\nDSM7.2<br \/>\nThinkphp\u4f2a\u9759\u6001 user.conf\u5185\u5bb9<\/p>\n<p>location \/ {<\/p>\n<p>if (!-e $request_filename) {<\/p>\n<p>rewrite ^(.*)$ \/index.php?s=$1 last;<\/p>\n<p>break;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p># \u4fdd\u5b58\u540e\u5728ssh\u91cc\u91cd\u542fnginx\u6216\u8005web Station\u505c\u7528\u518d\u542f\u7528<br \/>\n# nginx -s reload<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5904\u7406\u8fc7\u7a0b ssh user@19&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-1408","post","type-post","status-publish","format-standard","hentry","category-hkc","category-synology"],"_links":{"self":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/1408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1408"}],"version-history":[{"count":1,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/1408\/revisions"}],"predecessor-version":[{"id":1409,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/1408\/revisions\/1409"}],"wp:attachment":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}