Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
How to authorize reading of directories and limit the downloading of files to only authenticated users on Apache 2.4?

I want to authorize the consultation of directories hosted on Apache 2.4 and limit the downloading of files to only authenticated users.

The files are very large and cannot be downloaded via scripting language due to memory limitation.

Is there an alternative of the Nginx ngx_http_auth_request_module module on Apache?

I want to migrate my Nginx web server to Apache 2.4, here is the solution I am currently using on Nginx:

Nginx configuration

location ~ .+(?<!/)$ 
{ 
    auth_request /auth.php;
    error_page 401 = @login;
}

location @login 
{
    internal;
    return 302 /account/login.php;
}

auth.php

ob_start();
session_start();

if( isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true ) {

    header("HTTP/1.1 200 OK");

} else {

    header("HTTP/1.1 401 Unauthorized");
}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda