{"id":32801,"date":"2023-09-02T12:28:23","date_gmt":"2023-04-03T05:40:59","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/"},"modified":"2024-01-15T07:30:41","modified_gmt":"2024-01-14T23:30:41","slug":"%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/","title":{"rendered":"\u4f7f\u7528Nginx\u8fd0\u884cLaravel"},"content":{"rendered":"<p>\u9996\u5148\uff0c\u5728\/var\/www\/html\u4e0b\u521b\u5efa\u4e00\u4e2aLaravel\u9879\u76ee\u3002<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a\/var\/www\/html\/helloworld\u7684\u9879\u76ee\uff0c\u6211\u4eec\u5c06\/var\/www\/html\/helloworld\/public\u8bbe\u7f6e\u4e3aNginx\u7684\u6839\u76ee\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code>server {\r\n        listen 80 default_server;\r\n        listen [::]:80 default_server;\r\n\r\n        root \/var\/www\/html\/helloworld\/public;\r\n        index index.html index.htm index.php;\r\n\r\n        server_name _;\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ \/index.php?$query_string;\r\n        }\r\n\r\n        location ~ \\.php$ {\r\n                include snippets\/fastcgi-php.conf;\r\n                fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock;\r\n        }\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u786e\u8ba4\u8bbe\u7f6e\u6587\u4ef6\u662f\u5426\u6b63\u786e\u3002<\/p>\n<pre class=\"post-pre\"><code>$ sudo nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\n<\/code><\/pre>\n<p>\u91cd\u65b0\u542f\u52a8Nginx<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo <\/span>systemctl restart nginx\r\n<\/code><\/pre>\n<p>\u6211\u5728\u4e0b\u4e00\u4e2a\u7248\u672c\u4e2d\u8fdb\u884c\u4e86\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>$ nginx -v\r\nnginx version: nginx\/1.18.0 (Ubuntu)\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u5728\/var\/www\/html\u4e0b\u521b\u5efa\u4e00\u4e2aLaravel\u9879\u76ee\u3002 \u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a\/var\/www\/html [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32801","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528Nginx\u8fd0\u884cLaravel - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528nginx\u8fd0\u884claravel\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Nginx\u8fd0\u884cLaravel\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148\uff0c\u5728\/var\/www\/html\u4e0b\u521b\u5efa\u4e00\u4e2aLaravel\u9879\u76ee\u3002 \u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a\/var\/www\/html [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528nginx\u8fd0\u884claravel\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-03T05:40:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-14T23:30:41+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u9896\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u9896\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/\",\"name\":\"\u4f7f\u7528Nginx\u8fd0\u884cLaravel - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-03T05:40:59+00:00\",\"dateModified\":\"2024-01-14T23:30:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Nginx\u8fd0\u884cLaravel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\",\"name\":\"\u79d1, \u9896\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u9896\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Nginx\u8fd0\u884cLaravel - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528nginx\u8fd0\u884claravel\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Nginx\u8fd0\u884cLaravel","og_description":"\u9996\u5148\uff0c\u5728\/var\/www\/html\u4e0b\u521b\u5efa\u4e00\u4e2aLaravel\u9879\u76ee\u3002 \u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3a\/var\/www\/html [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528nginx\u8fd0\u884claravel\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-03T05:40:59+00:00","article_modified_time":"2024-01-14T23:30:41+00:00","author":"\u79d1, \u9896","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u9896"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/","name":"\u4f7f\u7528Nginx\u8fd0\u884cLaravel - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-03T05:40:59+00:00","dateModified":"2024-01-14T23:30:41+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Nginx\u8fd0\u884cLaravel"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e","name":"\u79d1, \u9896","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","caption":"\u79d1, \u9896"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8nginx%e8%bf%90%e8%a1%8claravel\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=32801"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32801\/revisions"}],"predecessor-version":[{"id":57383,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/32801\/revisions\/57383"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=32801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=32801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=32801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}