当前位置:网站首页>Nuxt SSR packaging and deployment

Nuxt SSR packaging and deployment

2022-06-21 23:26:00 samscat

  1. function yarn build Package project files , Then package and upload the files in the following red boxes to the server file directory , For example ‘www’ Create a new one in the directory ‘test123’
     Insert picture description here
  2. stay test123 Open the console in the directory , function yarn perhaps npm i Download dependency package ( Premise : Installed... On the server node In the environment )
  3. After the dependent package is downloaded, you can run yarn start, You can view the running page
  4. Turn on ngnix And configuring agents ( Use the domain name to browse the website ), With phpstudy For example :
    Create a new website , Then open nginx service
     Insert picture description here

 Insert picture description here

open test123 Website , At this point, you will see the default www Below index.html

modify ngnix The configuration file , find server object , Add port 、 domain name ( perhaps ip Address ) And agency address

 Insert picture description here

 Insert picture description here

Save your changes and restart ngnix, And on again test123 Website , You can browse the agent's website .


Reopen phpstudy, The following errors are reported when the service is restarted
nginx: [warn] conflicting server name “test123” on 0.0.0.0:80, ignored
Open profile vhost.conf Find out test123 There are repeated configurations below , Restart after deletion
 Insert picture description here

原网站

版权声明
本文为[samscat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206212036535208.html