问题描述
我想只允许来自加拿大的访客,但这似乎不起作用。即使我试图从加拿大访问,它也会阻止我。
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
SetEnvIf GEOIP_COUNTRY_CODE CA AllowCountry
Deny from all
Allow from env=AllowCountry
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com$1 [L]
</Directory>
在我的/etc/apache2/sites-enabled/000-default.conf
中:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName my.nextcloud.net
DocumentRoot /var/www/html
GeoIPEnable On
GeoipdbFile /etc/apache2/GeoIP.dat MemoryCache
GeoIPOutput Env
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)