Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Deploy build-dist to ngnix - only html-page will be shown


I want to deploy the build "dist" to production.
In production i have installed a nginx and configured it like examples for vue-apps.
Wenn request the page only the index.html will be delivered - without any js and css

This is my nginx block

root /var/www/<domain>/html/dist;
#index index.html index.htm index.nginx-debian.html;
index index.html;

charset utf-8;

server_name <domain>;

location /venser-app/ {
root /var/www/<domain>/html/dist;
try_files $uri $uri/ /index.html;
}


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi Heico,

Thank you for reaching out to us.

Typically, these errors occur when deploying your app on a relative path without updating the app's base path.

In the Metronic Vue version, the default base path is /metronic8/react/demo1/. If you're deploying your app to the server's root folder, you can set the base path to /.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Can you show the html site ? Are you using absolute or relative paths? like

<link rel="stylesheet" href="/style.css">

or

<link rel="stylesheet" href="./style.css">


And whats the error on your console ?



if its absolute path like /filename then try changing it to ./filename


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(