Estou tentando converter algum conjunto de regras do Apache para nginx.
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
Mas, até agora vim com esta configuração Nginx.
server {
listen 80;
server_name example.com;
root /path/to/your/document/root;
# Serve files from the public directory if they have an extension
location ~* \.\w+$ {
rewrite ^(.*)$ /public/$1 break;
}
# Route all other requests to server.php
location / {
try_files $uri $uri/ /server.php;
}
}
Não está funcionando
como posso consertar isso