# Permitir Página Inicial Arbitrária (por Jay Pfaffman)

**URL:** <https://meta.discourse.org/t/allow-arbitrary-homepage-by-jay-pfaffman/152459>\
**Category:** Theme component\
**Created:** [Maio 23, 2020, 4:07pm UTC](https://meta.discourse.org/t/allow-arbitrary-homepage-by-jay-pfaffman/152459 "2020-05-23T16:07:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)\
**Post date:** [Maio 23, 2020, 4:58pm UTC](https://meta.discourse.org/t/allow-arbitrary-homepage-by-jay-pfaffman/152459/4 "2020-05-23T16:58:55Z")

</div>

Ah, então o arquivo deve ser o padrão — geralmente `index.html`?

De fato, funciona! O componente espera que a URL seja um arquivo `index`, certo?

Bastou renomear meu `home.html` para `index.html` e alterar a configuração do Nginx para:

```ini
        # mais configuração...
        root /srv/www/zoethical.org/thx;
        index index.html; # <- isso é importante

        location = /TransHack_·Xist·nce… {
                default_type text/html;
                alias /srv/www/zoethical.org/thx/index.html; # <- e corresponde
        }
        location / {
                # mágica do nginx para tentar o arquivo local antes de fazer o proxy...
                try_files $uri $uri/ $uri.html @discourse;
        }
        location @discourse {
                # proxy normal do Discourse
        }

```

## Então, para resumir…

Se você estiver usando uma página estática no mesmo site que a instância do Discourse, certifique-se de que seu servidor web leia o(s) arquivo(s) estático(s) — por exemplo, CSS relacionado — antes de encaminhar as solicitações para o Discourse. Tadaa!

Obrigado, @pfaffman!

---

_[View the full topic](https://meta.discourse.org/t/allow-arbitrary-homepage-by-jay-pfaffman/152459)._
