Skip to content

Nginx Configuration #69

@square-foot

Description

@square-foot

Hi

.htaccess is useful only for Apache websites. I am trying out the following server configuration (usually kept in the /etc/sites-available folder) for Nginx

location / {
    if ($request_filename ~* \.(png|jpg|webp|gif|jpeg|zip|css|svg|js|pdf|html)$) {
        break;
    }

    try_files $uri /routes.php$is_args$args;

  
}

It seems to work. I wanted to send .html files directly instead of routing thru routes.php but that is working if I specify the .html file on the URL but if I do not give it, it should have sent it to index.html automatically,... possibly the routes.php has stuck onto the bare minimum "/" url I wonder how to make it go to /index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions