部署VUE项目到Linux
server {
listen 8857;
server_name 106.52.69.26;
# 注意设定 root路径是有dist的
location / {
root /www/wwwroot/crm.hnmgyl.com;
index /index.html;
}
}
- Nginx Linux详细安装部署教程 https://www.cnblogs.com/taiyonghai/p/6728707.html
- Linux下部署vue项目 https://www.lxlinux.net/2329.html
- 使配置生效xshell命令
sbin/nginx -s reload
sbin/nginx -s stop
sbin/nginx
nginx.conf 文件内容如下,配置多个server节点(一个server节点代表一个应用项目)
nginx.conf 文件在服务器上的路径:/www/server/nginx/conf/nginx.conf
user www www;
worker_processes auto;
error_log /www/wwwlogs/nginx_error.log crit;
pid /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
server {
listen 8857;
server_name 106.52.69.26;
# 注意设定 root路径
location / {
root /www/wwwroot/crm.hnmgyl.com;
index /index.html;
}
}
server
{
listen 888;
server_name phpmyadmin;
index index.html index.htm index.php;
root /www/server/phpmyadmin;
location ~ /tmp/ {
return 403;
}
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /www/wwwlogs/access.log;
}
include /www/server/panel/vhost/nginx/*.conf;
}
部署后后台使用这些代码上传到服务器
supervisorctl stop dotnet:停止dotnet
supervisorctl start dotnet:启动dotnet
supervisorctl restart dotnet: 重启dotnet
supervisorctl update :配置文件修改后可以使用该命令加载新的配置
supervisorctl reload: 重新启动配置中的所有程序
部署后前端使用这些代码上传到服务器
sbin/nginx -s reload
sbin/nginx -s stop
sbin/nginx