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