Hello guys, i am migration from an Apache server that has a couple of folders, each one with the same .htaccess file as listed below... Need to convert it to a NGINX config. Can you help me?
* pesquisa/.htaccess
* app/.htaccess
* qrcode/.htaccess
* dashboard/.htaccess
* protocolo/.htaccess
* painel/thumb/.htaccess
* painel/.htaccess
.htaccess content:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?parametros=$1
I already tried to convert it with the conf below:
server {
listen 80 default_server;
root /var/www/html;
index index.php index.html index.htm;
### Rewrite engine rules converted from .htaccess
location ˜ ^/(?:pesquisa|app|qrcode|dashboard|protocolo|painel/thumb|painel)$ {
if ($script_filename !~ "-f"){
rewrite ^(.*)$ /index.php?parametros=$1;
}
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
But it gives ERR_CONNECTION_REFUSED. What i am doing wrong ?