M
M
mr_mescaline2015-02-28 15:00:15
Nginx
mr_mescaline, 2015-02-28 15:00:15

How to configure nginx rules?

there is such a config for Apache (more precisely .hataccess)
AddCharset UTF-8 .php
AddDefaultCharset Off
RewriteEngine on
RewriteBase /import/
#If in directory RewriteBase /directory_name/import/
RewriteCond $1 !^(system|application|robots\\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
needs to be converted to nginx
--------
tried using
nginx configuration converter
location /import/ {
if (!-e $request_filename){
rewrite ^/import/(.*)$ /import/index.php?/$1 break;
}
}
didn't work
-------------
----------------------------
via another service
if ($1 !~ "^(system|application|robots\.txt)") {
set $rule_0 1$rule_0;
}
if (!-f $request_filename){
set $rule_0 2$rule_0;
}
if (!-d $request_filename){
set $rule_0 3$rule_0;
}
if ($rule_0 = "321"){
rewrite ^/(.*)$ /index.php?/$1 last;
}
--------------------
When restarting the server, I cursed at zero. I tried to replace the zeros, it's all the same.
where is the mistake ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ad4ptec, 2015-03-09
@Ad4ptec

Through the winginx service, it issues the following code

# nginx configuration
charset off;
location /import/ {
if (!-e $request_filename){
rewrite ^/import/(.*)$ /import/index.php?/$1 break;
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question