美文网首页
2019-01-08tp5.1nginx配置

2019-01-08tp5.1nginx配置

作者: cuiyao50 | 来源:发表于2019-01-08 10:26 被阅读0次

    index index.html index.htm index.php;

    root /data/wwwroot/task.fzyunyin.cn/public;

    location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv|mp4)$ {

        valid_referers none blocked *.fzyunyin.cn task.fzyunyin.cn;

        if ($invalid_referer) {

            return 403;

        }

      }

    location ~\.php$ {

        fastcgi_pass unix:/dev/shm/php-cgi.sock;#一定要注意正确配置fastcgi_pass的路径和起点

        fastcgi_index index.php;

        fastcgi_split_path_info ^(.+\.php)(.*)$;

        include fastcgi.conf;

      }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {

        expires 30d;

        access_log off;

      }

      location ~ .*\.(js|css)?$ {

        expires 7d;

        access_log off;

      }

      location ~ /\.ht {

        deny all;

      }

      location ~.*\.(sql|log|txt|jar|war|sh|py) {

        deny all;

      }

    相关文章

      网友评论

          本文标题:2019-01-08tp5.1nginx配置

          本文链接:https://www.haomeiwen.com/subject/uthvrqtx.html