IIS7 - установите доменное имя для отображения страницы обслуживания для всего дюйм/с, но моего

Мне нравится iTap мобильный клиент RDP. Это поддерживает все средства защиты RDP включая TS-шлюз.

-1
задан 6 August 2013 в 18:55
2 ответа

Basic IIS setup will let you block/allow based on IP. If you want to redirect a user based on IP, you should look at URL Rewrite (http://www.iis.net/downloads/microsoft/url-rewrite). Specifically, an inbound rule that works off the condition REMOTE_ADDR.

1
ответ дан 5 December 2019 в 19:29

Verify that you have the 'IP and Domain Restrictions module' installed, if not, install it:

start /w pkgmgr.exe /iu:IIS-IPSecurity;

Only allow your own IP address to access the site:

appcmd.exe set config "Default Web Site" -section:system.webServer/security/ipSecurity /allowUnlisted:"False"  /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/ipSecurity /+"[ipAddress='192.168.1.9',allowed='True']" /commit:apphost

now everybody else gets a standard IIS "403 - Forbidden: Access is denied" page.

You want to replace this page with your own. Build an Html page that has no dependencies on any other resources, include the css on the page, and also all images:

background-image:url(data:image/jpeg;base64,/9j/4AAQSkZJ...

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEU...

You need to encode your images into base64, but you can create a nice enough looking page without images.

You could also references images on another server, but I like to keep my error pages self-contained.

Save the file to the root of your site e.g.: C:\inetpub\wwwroot\403.html

finally set IIS to use your new page:

C:\Windows\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/httpErrors 

C:\Windows\system32\inetsrv\appcmd.exe set config "Default Web Site" -section:system.webServer/httpErrors /[statusCode='403',subStatusCode='-1'].prefixLanguageFilePath:"" /[statusCode='403',subStatusCode='-1'].path:"403.html"

Your page will now be displayed for all 403 status codes, not just IP restrictions, but that shouldn't be a big problem.

1
ответ дан 5 December 2019 в 19:29

Теги

Похожие вопросы