protect dotenv file from being accessed #22
This commit is contained in:
parent
3107cc2bcb
commit
054c7d87ed
|
|
@ -4,3 +4,9 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
|||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
|
||||
RewriteRule ^.*$ index.php [L]
|
||||
|
||||
# Protect .env file
|
||||
<Files .env>
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ $ bower install
|
|||
使用 gulp 构建前端代码:
|
||||
|
||||
```
|
||||
$ gulp copy
|
||||
$ gulp build
|
||||
$ gulp copy && gulp build
|
||||
```
|
||||
|
||||
可以开始使用啦~
|
||||
|
|
@ -90,6 +89,12 @@ $ gulp build
|
|||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
# Protect .env file
|
||||
location ~ /\.env
|
||||
{
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
|
||||
现在你可以访问 `http://example.com/{ player_name }.json` 来得到你的首选 API(可在后台配置)的 JSON 用户数据。另外一个 API 的 JSON 数据可以通过访问 `http://example.com/(usm|csl)/{ player_name }.json` 得到。
|
||||
|
|
|
|||
|
|
@ -17,4 +17,13 @@
|
|||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
|
||||
<!-- Protect .env file -->
|
||||
<location path=".env">
|
||||
<system.web>
|
||||
<authorization>
|
||||
<deny users="*"/>
|
||||
</authorization>
|
||||
</system.web>
|
||||
</location>
|
||||
</configuration>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user