V
V
Vyacheslav Shevchenko2019-03-29 20:14:56
Nginx
Vyacheslav Shevchenko, 2019-03-29 20:14:56

How to setup nginx+nuxt+apache?

There is a site on nuxt that is given by any url except /backend. On /backend there will be october cms (not present) on apache.
The folder structure is:
/front - nuxt
/back - will be october cms, now just index.php with phpinfo();
I managed to make nginx give nuxt. But when I request /backend, I get an error 404, and if I create a folder /backend/backend and place index.php in it, then the file is processed. It turns out I can not access the root / backend. How can I make it so that when I request /backend, I work with starting from Korea.
Now nginx config looks like this:

map $sent_http_content_type $expires {
    "text/html"                 epoch;
    "text/html; charset=utf-8"  epoch;
    default                     off;
}

server {
    listen          80;
    server_name     мой сайт;

    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;

    location / {
        expires $expires;

        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                  http://127.0.0.1:3000;
    }

    location /backend/ {
            expires $expires;

            proxy_redirect                      off;
            proxy_set_header Host               $host;
            proxy_set_header X-Real-IP          $remote_addr;
            proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
            proxy_read_timeout          1m;
            proxy_connect_timeout       1m;
            proxy_pass                  http://127.0.0.1:8888/;
        }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Shevchenko, 2019-03-29
@WebDev2030

Looks like the rewrite line was needed ^/backend(/.*)$ $1 break;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question