Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda