Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

520
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!