Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

514
Vistas
How to configure Vue.js and simple html app with nginx?

I have one Vue.js app and a REST api which i am hosting with nginx. At / root url there is just a simple index.html page. /api/ has a REST server and /app has vue.js app

My configurations are..

server {

       listen 80;
       listen 443 ssl;
       server_name _;
       root /usr/share/backend;
       ssl_certificate /etc/nginx/ssl/server.crt;
       ssl_certificate_key /etc/nginx/ssl/server.key;
       location / {
           index index.html;
       }
       location /api/ {
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host            $http_host;
                proxy_pass http://localhost:8080/;
        }
       location /app {
                alias /usr/lib/App/;
                try_files /index.html /friendly_404;
        }

       location /friendly_404 {
                return 404 "Sorry, that file could not be found.";
       }

       error_log  /var/log/nginx/vue-app-error.log;
       access_log /var/log/nginx/vue-app-access.log;

}

My /api/ server is working without any problem but vue.js /app is not working and on my browser its giving me some like multiple errors like this one below.

GET http://192.168.0.1/js/chunk-d9925106.16c4e8be.js net::ERR_ABORTED 404 (Not Found)

Vue.js Config is..

module.exports = {
  // ...other vue-cli plugin options...
  publicPath: '/app/',
  configureWebpack: {
    plugins: [
    ]
  },

  productionSourceMap: false,
}

What am I doing wrong here?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda