Laravel how to set Nginx pseudo-static?

Source: Internet
Author: User
Tags php server
According to the official website set up the direct non-analytic web page into a download, try a lot of online version is useless.
With the LNMP one-click installation environment.

My Vhost configuration information:

  server {Listen 80;        #listen [::]:80;        server_name domain.com;        Index index.html index.htm index.php default.html default.htm default.php server.php;        Root/home/wwwroot/domain.com/public;        #error_page 404/404.html;        Location/{try_files $uri $uri//index.php? $query _string;                } location ~ [^/]\.php (/|$) {# comment Try_files $uri =404, to enable PathInfo                Try_files $uri = 404;                Fastcgi_pass Unix:/tmp/php-cgi.sock;                Fastcgi_index index.php;                Include fastcgi.conf;            #include pathinfo.conf; } location ~. *\.            (gif|jpg|jpeg|png|bmp|swf) $ {expires 30d; } location ~. *\.            (JS|CSS)? $ {Expires 12h;    } Access_log/home/wwwlogs/domain.log Access; }

Reply content:

According to the official website set up the direct non-analytic web page into a download, try a lot of online version is useless.
With the LNMP one-click installation environment.

My Vhost configuration information:

  server {Listen 80;        #listen [::]:80;        server_name domain.com;        Index index.html index.htm index.php default.html default.htm default.php server.php;        Root/home/wwwroot/domain.com/public;        #error_page 404/404.html;        Location/{try_files $uri $uri//index.php? $query _string;                } location ~ [^/]\.php (/|$) {# comment Try_files $uri =404, to enable PathInfo                Try_files $uri = 404;                Fastcgi_pass Unix:/tmp/php-cgi.sock;                Fastcgi_index index.php;                Include fastcgi.conf;            #include pathinfo.conf; } location ~. *\.            (gif|jpg|jpeg|png|bmp|swf) $ {expires 30d; } location ~. *\.            (JS|CSS)? $ {Expires 12h;    } Access_log/home/wwwlogs/domain.log Access; }

My configuration is this:

server{Listen 80;    server_name b.phodal.com;    Index index.html index.htm index.php default.html default.htm default.php;    Root/home/www/mk_iot/public;    Include other.conf; Location ~. *\.            (PHP|PHP5)? $ {try_files $uri = 404;            Fastcgi_pass Unix:/tmp/php-cgi.sock;            Fastcgi_index index.php;        Include fcgi.conf; } location ~. *\.        (gif|jpg|jpeg|png|bmp|swf) $ {expires 30d; } location ~. *\.        (JS|CSS)? $ {Expires 12h;            } if (!-d $request _filename) {rewrite ^/(. +)/$/$1 permanent;                } # Removes trailing "index" from all controllers if ($request _uri ~* index/?$) {            Rewrite ^/(. *)/index/?$/$1 Permanent; # unless the request is a valid file (image, JS, CSS, etc), send to Bootstrap if (!-e $reques               T_filename) { Rewrite ^/(. *) $/index.php?/$1 last;            Break } Access_log/home/wwwlogs/b.phodal.com.log b.phodal.com;}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.