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

231
Vistas
Nginx set root to subfolder

With Nginx, i need the download folder to become the home page of my website, while still allowing the terms.html page to appear at the root. The download folder displays the list of files with the fancyindex and fancyindex_header directives.

I did this: root /var/www/html/download; but I no longer have access to pages outside the download folder like terms.html

does nginx allow this configuration? here is the structure of my directories:

www/
    /download/  # fancyindex on + home page
    /account/
            /index.php
            /login.php
            /signup.php
    /css/
    /js/
    robots.txt
    terms.html
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If your directory structure follows your URI structure, you should probably set the root to /var/www/html at the server level and use /var/www/html/download for one location only.

For example:

server {
    ...
    root /var/www/html;

    location / {
        root /var/www/html/download;
        fancyindex on;
    }
    location /account/ {
        ... # PHP stuff
    }
    location /css/ { }
    location /js/ { }
    location = /robots.txt { }
    location = /terms.html { }

The last four blocks can be empty, as they inherit the value of root from the surrounding block. See this document for details.

over 4 years ago · Santiago Trujillo Denunciar
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