Thavarshan
7 months ago

NGINX Configuration file for non-Laravel projects

Posted 7 months ago by Thavarshan

I'm working on a non-laravel project (Building my own custom PHP framework). I'm following another Github repo for this and the repo consists of a nginx-configuration.txt file. I'm running Laravel Valet and since I'm still learning I'm not quite sure where and how and where to add the NGINX config file.

This would be the nginx-configuration.txt file. I have.


# nginx configuration to remove the question mark from the URL but maintain the query string

location / { 
    if (!-f $request_filename){
        set $rule_0 1$rule_0;
    }   
    if (!-d $request_filename){
        set $rule_0 2$rule_0;
    }
    if ($rule_0 = "21"){
        rewrite ^/(.*)$ /index.php? last;
    }   
}

Please sign in or create an account to participate in this conversation.