{"id":165178,"date":"2020-09-29T18:15:32","date_gmt":"2020-09-29T10:15:32","guid":{"rendered":"http:\/\/4563.org\/?p=165178"},"modified":"2020-09-29T18:15:32","modified_gmt":"2020-09-29T10:15:32","slug":"nginx-%e5%8f%8d%e4%bb%a3%e4%b8%8e%e6%a0%b9%e7%9b%ae%e5%bd%95-php-%e5%85%b1%e5%ad%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=165178","title":{"rendered":"nginx \u53cd\u4ee3\u4e0e\u6839\u76ee\u5f55 PHP \u5171\u5b58"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  nginx \u53cd\u4ee3\u4e0e\u6839\u76ee\u5f55 PHP \u5171\u5b58               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Backlitz <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u9519\u8bef\u4fe1\u606f\uff1a \u5728 nginx \u7684\u4e00\u4e2a vhost \u914d\u7f6e\u4e2d\uff0c\u5728\u6839\u76ee\u5f55\u653e\u7f6e index.php \u6587\u4ef6\uff0c\u5e76\u4e3a\u5b50\u76ee\u5f55\u8bbe\u7f6e\u53cd\u4ee3\uff0c\u76f4\u63a5\u8bbf\u95ee\u57df\u540d\u65f6\u8fd4\u56de nginx403\uff0c\u9700\u624b\u52a8\u6dfb\u52a0 index.php \u65b9\u53ef\u6b63\u5e38\u8bbf\u95ee php \u3002<\/p>\n<p>\u731c\u6d4b\u539f\u56e0\uff1a \u5728\u4f7f\u7528 nginx \u53cd\u4ee3\u65f6\uff0c\u5c06\u53cd\u4ee3\u8bbe\u7f6e\u4e3a\u5b50\u76ee\u5f55\uff0clocation \u4f7f\u7528\u76f4\u63a5\u5339\u914d\u3002 \u800c\u5f15\u5165 php \u914d\u7f6e\u65f6\u4f7f\u7528\u6b63\u5219\u5339\u914d\u3002 \u76f4\u63a5\u5339\u914d\u4f18\u5148\u7ea7\u9ad8\u4e8e\u6b63\u5219\u5339\u914d\u3002<\/p>\n<p>\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n<pre><code>server {     listen 443 ssl http2;     server_name domain_name;     root \/home\/www;     index index.php;          #ssl \u914d\u7f6e\u7565\u53bb          location ~ .php$ {         include fastcgi_params;         fastcgi_intercept_errors on;         fastcgi_pass unix:\/var\/run\/php\/php7.3-fpm.sock;         fastcgi_param SCRIPT_FILENAME $document_root\/$fastcgi_script_name;     }      location \/deluge\/ {         proxy_pass http:\/\/localhost:8112\/;         proxy_set_header X-Deluge-Base \"\/deluge\/\";         add_header X-Frame-Options SAMEORIGIN;     } } <\/code><\/pre>\n<p>\u5c1d\u8bd5\u89e3\u51b3\uff1a \u5c06 <code>location ~ .php$ {<\/code> \u4fee\u6539\u4e3a\u5f3a\u5236\u5339\u914d <code>location = \/ {<\/code> \u5728 location \u6a21\u5757\u4e2d\u4f7f\u7528 alias \u6307\u5411\u7edd\u5bf9\u76ee\u5f55<\/p>\n<pre><code>    location = \/ {         include fastcgi_params;         fastcgi_intercept_errors on;         fastcgi_pass unix:\/var\/run\/php\/php7.3-fpm.sock;         fastcgi_param SCRIPT_FILENAME $document_root\/$fastcgi_script_name;         index index.php         alias \/home\/www;     } <\/code><\/pre>\n<p>\u8bbf\u95ee\u7f51\u9875\uff0c\u8fd4\u56de\u7eaf\u6587\u672c\u5185\u5bb9 File not found.<\/p>\n<p>\u5df2\u77e5\u5728\u4e0d\u8bbe\u7f6e\u5b50\u76ee\u5f55\u53cd\u4ee3\u65f6\uff0c\u8be5\u914d\u7f6e php \u53ef\u6b63\u5e38\u8bbf\u95ee\u3002<\/p>\n<p>\u8bf7\u95ee\u662f\u5426\u6709\u529e\u6cd5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>1<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3631173\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : masker <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5efa\u8bae\u5b66\u4f1a\u81ea\u5df1\u52a8\u624b\u627e \u8c37\u6b4c and \u770b\u76f8\u5e94\u65e5\u5fd7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>nginx \u53cd\u4ee3\u4e0e\u6839\u76ee\u5f55 PHP &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\/165178"}],"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=165178"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/165178\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165178"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}