Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

_chris's avatar

Forge/Nginx static HTML routing

Hi all,

I'm using forge for a static HTML site and need to add a second page (so index.html and about.html). I don't want to use a framework because the site is so small.

With the default Nginx settings I can navigate to: domain.com/index and domain.com/about.html

but domain.com/about does not work.

I changed the Nginx config and added $uri.html to the location section like so:

location / {
    try_files $uri $uri.html $uri/ /index.php?$query_string;
}

This now works but I just wanted to check this is an ok way of doing it? I don't know much about Nginx so want to check I've not broken something!

EDIT: It's just occurred to me that I could also remove the php specific part to that section if I'm only using HTML?

Thanks!

0 likes
1 reply

Please or to participate in this conversation.