nginx conf 文件
生活随笔
收集整理的這篇文章主要介紹了
nginx conf 文件
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
server{listen 80;server_name local.light.com;index index.html index.htm index.php;root /home/wwwroot/default/******/Public; // !!!! 所在的文件需要有可執(zhí)行權(quán)限, 一般是755 的權(quán)限,否則會(huì)報(bào)403 找不到文件 的錯(cuò)誤#error_page 404 /404.html;include enable-php-pathinfo.conf;location /nginx_status{stub_status on;access_log off;}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 12h;}location ~ /\.{deny all;}access_log /home/wwwlogs/access_****.log;}
include enable-php-pathinfo.conf; 這里很重要 有時(shí)候引入enable-php.conf 文件
如果這里注釋掉,將解析不了php文件,就會(huì)出現(xiàn)訪問(wèn)php文件,直接下載了php文件的發(fā)生!
?
include enable-php-pathinfo.conf; 這里很重要 有時(shí)候引入enable-php.conf 文件
如果這里注釋掉,將解析不了php文件,就會(huì)出現(xiàn)訪問(wèn)php文件,直接下載了php文件的發(fā)生!
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/pansidong/p/11124486.html
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的nginx conf 文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Day 31 并发编程
- 下一篇: Linux下grep显示前后几行信息