Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

515
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda