A
A
Alexander Arbuzov2018-05-07 12:37:03
Nginx
Alexander Arbuzov, 2018-05-07 12:37:03

How to write a rule for nginx?

Good afternoon. Help with settings.
The site has a wi directory with all sorts of scripts.
Site migrated from apache to nginx.
The config contains rules for this folder:

location / {
        #root   /usr/share/nginx/html;

        root   /web/html/site.ru;

        .....

        autoindex off;

        location = /wi {
            rewrite ^(.*)$ /wi/;
        }

        location /wi\/ {
            alias /wi/;
        }

        rewrite ^/([A-Za-z0-9\/\-\_]+)$ /index.php?path=$1;
        rewrite ^/([A-Za-z0-9\/\-\_]+)\/$ /index.php?path=$1;

        index  index.php;
    }

Error ERR_TOO_MANY_REDIRECTS when trying to login

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2018-05-07
@Stalker_RED

Read Proper Nginx Configuration especially section Passing Requests to PHP I
also recommend: How nginx handles requests
Configs to follow: https://github.com/elasticweb/nginx-configs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question