Welcome! Log In Create A New Profile

Advanced

Rewrite .htaccess on nginx

September 01, 2020 03:34PM
i want to do this in nginx

Options All -Indexes
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


when converting it as it appears in several forums it gives me this script

user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;








events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

autoindex off;

autoindex off;

location / {
if (!-e $request_filename){
rewrite ^(.*)$ index.php?url=$1 break;
}
}



#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

include "C:/laragon/etc/nginx/php_upstream.conf";
include "C:/laragon/etc/nginx/sites-enabled/*.conf";
client_max_body_size 2000M;
server_names_hash_bucket_size 64;





}


DOES NOT START NGIX AND I GET THE FOLLOWING ERROR

SERVICE NGINX CANNOT START RASON :

NGINX EMERG LOCATION IS NOT ALLOWED HERE IN C.\LARAGON\BIN\NGINX\NGINX1.14.0/CONF/NGINX.CONF:37

HELPPPP ME PLEASE
Subject Author Posted

Rewrite .htaccess on nginx

Jorge Enrique Diaz September 01, 2020 03:34PM

Re: Rewrite .htaccess on nginx

Francis Daly September 01, 2020 06:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 297
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready