M
M
Maxim Stikharev2019-08-20 20:21:09
Nginx
Maxim Stikharev, 2019-08-20 20:21:09

How to set up multiple applications in one nginx?

There are:
1. Two Vue apps one using nuxt.js and one without
2. Generated index.html template from nuxt.js
3. Generated build of vue app
4. Not working nginx config :(
My config

server {

  server_name mysite.com;

  listen 80;

  location / {
      root /home/django/projects/hq/hq-landing/dist/;
      index index.html;
  }

  location /app/ {
      root /home/django/projects/hq/hq-frontend/front/dist/;
      try_files $uri $uri/ /index.html;
  }
}

For some reason, this config proxies all requests to the root and always index.html of the nuxt application
What I ideally want, but I can’t figure out how to configure:
1. Proxy to the root of the index.html file of the nuxt application
2. Proxy other requests to the index.html file of the vue application without nuxt
I'm trying to move all requests to the application to customurl and rewrite /app/ so as not to change the routing in the vue application, but also without success

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question