当前位置: 首页 > 后端技术 > PHP

Laravel5.5官方推荐Nginx配置学习

时间:2023-03-30 04:21:51 PHP

Laravel5.5版本正式发布Nginx服务器配置,中文文档:服务器配置Nginxserver{listen80;服务器名称example.com;根/example.com/public;add_headerX-Frame-Options"SAMEORIGIN";add_headerX-XSS-Protection"1;mode=block";add_headerX-Content-Type-Options"nosniff";indexindex.htmlindex.htmindex.php;字符集utf-8;location/{try_files$uri$uri//index.php?$query_string;}location=/favicon.ico{access_logoff;log_not_found关闭;}location=/robots.txt{access_logoff;log_not_found关闭;}error_page404/index.php;~\.php${fastcgi_split_path_info^(.+\.php)(/.+)$;fastcgi_passunix:/var/run/php/php7.1-fpm.sock;fastcgi_indexindex.php;包括fastcgi_params;}location~/\.(?!well-known).*{denyall;}}我对Nginx不是很擅长,相信很多朋友都和我一样,让我们??一起来学习一下Nginx吧:)1。add_headerX-Frame-选项"SAMEORIGIN";X-Frame-Options响应头用于向浏览器指示页面是否允许在、