Score:0

Nginx rewrite - not working - convert from htaccess

dm flag

I have a .htaccess file and I'm trying to convert it to an NGINX URL Rewrite configuration. Unfortunately, none of the available converters help. Every time I get either a 403 error or 'No input file specified.'. PHP 8.1/nginx/aapanel

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    <Files .env>
        Order allow,deny
        Deny from all
    </Files>
</IfModule>

The problem is that authorization probably, which I can't get around :(

kz flag
"The problem is that authorization probably" - You probably don't need that at all on Nginx. That rule is to get around a security restriction on Apache when PHP is installed as a CGI script. (That rule is also only relevant if you are using HTTP Authentication with your backend application.)
us flag
What is the nginx configuration you are using?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.