Converted rules from multiple .htaccess apache gives CONNECTION REFUSED
July 06, 2021 11:12PM
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 ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready