B
B
barkovw2014-08-30 21:08:42
Nginx
barkovw, 2014-08-30 21:08:42

How to set up nginx redirects for frontend and backend on the same domain (Yii) ?

Hello.
I am writing a website in Yii2.
I am using a server with nginx.
There is the following directory structure:

backend
      themes
      web
           index.php
frontend
      themes
      web
           index.php

Using redirect nginx, I want to do the following redirects:
1) Frontend (redirect to frontend\web\index.php)
http://mydomain/
2) Backend (redirect to backend\web\index.php)
http://mydomain/backend
I couldn't implement it on my own after reading the documentation.
Please tell me how this can be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-30
Protko @Fesor

root /var/www/frontend/web;

location /backend/ {
    root /var/www/backend/web;
}

B
barkovw, 2014-08-30
@barkovw

it was not possible to configure nginx, I made two domains, it's easier that way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question