0

I currently have a VueJS application that has 2 parts. One being a static front end page and the other as a NodeJS express backend.

In the backend server, it will load the static(dist) folder as the front end view. The backend also contains some MongoDB api's to load and save some configuration.

I am currently trying to separate the two as each own docker container. I've managed to make the backend running but I am currently having some issues on running the front end. I'm having issues with configuring the nginx that will allow me to upload files to the server.

Here is my current nginx config

server{
listen 80;
root /var/www/html;
index index.html;

location /models/ {       
root  /app/upload;
}

location / {
    try_files $uri $uri/ /index.html;
}

}

So in the frontend, it will create a post request to the backend to upload some models but it seems that it is throwing: 405 (Not Allowed) error.

Is the issue because there is something wrong with the configuration or it cannot connect to the backend as it is in a separate container?

Any help/opinions with this is greatly appreciated. Thank you

  • Is there coming from nginx, or from your application? If you look at your application logs, do you see the request coming in? – larsks Jan 31 '21 at 14:24
  • yep, so I have another request in the backend server for logging in before uploading something and that is being hit. – Bryll Delfin Feb 01 '21 at 06:54
  • So for the `405` error; do you see that logged in the application (or any errors corresponding to that request)? – larsks Feb 01 '21 at 11:59
  • Yes, it was logged in the frontend application when I try to call the API to upload. But only in uploading, other request such as saving in the database and logging in seems to work. – Bryll Delfin Feb 02 '21 at 11:10

0 Answers0