================
for example we want to set https:// ( SLS Certificate) to my Custom domain from azure then the process is.
=============
If you still want to allow HTTP access to your app, skip this step. App Service does not enforce HTTPS, so visitors can still access your app using HTTP. If you want to enforce HTTPS for your app, you can define a rewrite rule in the
for example we want to set https:// ( SLS Certificate) to my Custom domain from azure then the process is.
=============
If you still want to allow HTTP access to your app, skip this step. App Service does not enforce HTTPS, so visitors can still access your app using HTTP. If you want to enforce HTTPS for your app, you can define a rewrite rule in the
web.config
file for your app. Every App Service app has this file, regardless of the language framework of your app.
Follow these steps:
- Navigate to the Kudu debug console for your app. Its address is
https://<appname>.scm.azurewebsites.net/DebugConsole
. - for Example- https://satyabrata.scm.azurewebsites.net/DebugConsole
- After that we login using azure uid and password. Next-
- In the debug console, CD to
D:\home\site\wwwroot
. - Open
web.config
by clicking the pencil button.
- If you deploy your app with Visual Studio or Git, App Service automatically generates the appropriate
web.config
for your .NET, PHP, Node.js, or Python app in the application root. Ifweb.config
doesn't exist, runtouch web.config
in the web-based command prompt to create it. Or, you can create it in your local project and redeploy your code. - If you had to create a
web.config
, copy the following code into it and save it. If you opened an existing web.config, then you just need to copy the entire<rule>
tag into yourweb.config
'sconfiguration/system.webServer/rewrite/rules
element.Copy<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <!-- BEGIN rule TAG FOR HTTPS REDIRECT --> <rule name="Force HTTPS" enabled="true"> <match url="(.*)" ignoreCase="false" /> <conditions> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> </rule> <!-- END rule TAG FOR HTTPS REDIRECT --> </rules> </rewrite> </system.webServer> </configuration>
This rule returns an HTTP 301 (permanent redire
No comments:
Post a Comment