wtorek, 26 stycznia 2021

.htaccess limit access to given resource

RewriteCond %{REQUEST_URI} ^(/file/path/file.php).*$


RewriteCond %{REMOTE_ADDR} !=192.168.1.0/24


RewriteCond %{REMOTE_ADDR} !=192.168.*


RewriteRule ^.*$ / [F]

środa, 20 stycznia 2021

Azure App Service + .well-known 404 error

 - create directory .well-known with dot

- create web.config inside of .well-known with

<?xml version="1.0"?>

<configuration>

  

  <system.web>

    <!-- Make directory public. Allow anonymous users access to everything in this directory. -->

    <authorization>

      <allow users="*"/>

    </authorization>

  </system.web>

  

  <system.webServer>

    <!-- Directory only contains plain text files. -->

    <staticContent>

      <mimeMap fileExtension=".*" mimeType="text/plain" />

    </staticContent>

    

    <!-- Only static files are allowed, so remove everything but the StaticFile handler. This also solves the issue with extensionless files returning a 404 Page Not Found. -->

    <handlers>

      <clear />

      <add name="StaticFile" path="*" verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />

    </handlers>

  </system.webServer>

  

</configuration>

Ubuntu force dhcp

 systemctl enable systemd-networkd



cat /etc/systemd/network/20-dhcp.network

[Match]

Name=enp*


[Network]

DHCP=ipv4