{"id":48964,"date":"2024-12-02T10:32:05","date_gmt":"2024-12-02T02:32:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/48964\/"},"modified":"2024-12-02T10:32:05","modified_gmt":"2024-12-02T02:32:05","slug":"laradock-nginx-%e9%85%8d%e7%bd%ae%e9%97%ae%e9%a2%98%ef%bc%9a%e7%bd%91%e7%ab%99%e5%90%8e%e5%8f%b0%e7%a9%ba%e7%99%bd%e9%a1%b5%e9%9d%a2%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/48964\/","title":{"rendered":"LARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>LARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f<\/h1>\n<p>\u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aLARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f\u300b<\/span>\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241105\/173077888067299700586ba.jpg\" class=\"aligncenter\" title=\"LARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"LARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>laradock nginx \u914d\u7f6e\u95ee\u9898\u5256\u6790<\/strong><\/p>\n<p>\u5728 laradock \u73af\u5883\u4e2d\uff0c\u914d\u7f6e\u4e86 nginx \u914d\u7f6e\u6587\u4ef6 laradocker\/nginx\/sites\/app.conf \u540e\u4ecd\u7136\u65e0\u6cd5\u6b63\u5e38\u8bbf\u95ee\u7f51\u7ad9\u540e\u53f0\uff0c\u9875\u9762\u663e\u793a\u7a7a\u767d\u3002\u5982\u4f55\u89e3\u51b3\u6b64\u95ee\u9898\uff1f<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u7f16\u8f91 app.conf \u6587\u4ef6\u5e76\u6309\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre>location ~ \\.php$ {\n    # try_files $uri \/index.php =404;\n    fastcgi_pass php-upstream;\n    fastcgi_index index.php;\n    fastcgi_buffers 16 16k;\n    fastcgi_buffer_size 32k;\n    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    #fixes timeouts\n    fastcgi_read_timeout 600;\n    include fastcgi_params;\n}\n\nlocation \/admin.php {\n    fastcgi_pass php-upstream;\n    fastcgi_param SCRIPT_FILENAME \/var\/www\/your_directionary\/admin.php;    \n    fastcgi_param PATH_INFO $fastcgi_path_info;    \n    fastcgi_split_path_info ^(.+\\.php)(.*)$;    \n    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;    \n    include fastcgi_params;\n}<\/pre>\n<p>\u8fd9\u4e9b\u914d\u7f6e\u4fee\u6539\u89e3\u51b3\u4e86\u4ee5\u4e0b\u95ee\u9898\uff1a<\/p>\n<ul>\n<li>location ~ .php$ \u5757\u5904\u7406\u6240\u6709 .php \u6587\u4ef6\u3002<\/li>\n<li>location \/admin.php \u5757\u4e13\u95e8\u5904\u7406 admin.php \u8def\u7531\uff0c\u89e3\u51b3 codeigniter \u540e\u53f0\u8bbf\u95ee\u95ee\u9898\u3002<\/li>\n<li>fastcgi_read_timeout 600 \u589e\u52a0 fastcgi \u8bfb\u8d85\u65f6\u65f6\u95f4\uff0c\u4ee5\u9632\u8bf7\u6c42\u8d85\u65f6\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f \u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u300aLARADOCK Nginx \u914d\u7f6e\u95ee\u9898\uff1a\u7f51\u7ad9\u540e\u53f0\u7a7a\u767d\u9875\u9762\u5982\u4f55\u89e3\u51b3\uff1f\u300b\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01 laradock nginx \u914d\u7f6e\u95ee\u9898\u5256\u6790 \u5728 laradock \u73af\u5883\u4e2d\uff0c\u914d\u7f6e\u4e86 nginx \u914d\u7f6e\u6587\u4ef6 laradocker\/nginx\/sites\/app.conf \u540e\u4ecd\u7136\u65e0\u6cd5\u6b63\u5e38\u8bbf\u95ee\u7f51\u7ad9\u540e\u53f0\uff0c\u9875\u9762\u663e\u793a\u7a7a\u767d\u3002\u5982\u4f55\u89e3\u51b3\u6b64\u95ee\u9898\uff1f \u89e3\u51b3\u65b9\u6848\uff1a \u7f16\u8f91 app.conf \u6587\u4ef6\u5e76\u6309\u5982\u4e0b\u914d\u7f6e\uff1a location ~ \\.php$ { # try_files $uri \/index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fixes timeouts fastcgi_read_timeout 600; include fastcgi_params; } location \/admin.php { fastcgi_pass php-upstream; fastcgi_param SCRIPT_FILENAME [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-48964","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=48964"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48964\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=48964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=48964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=48964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}