1、本地的访问网址的链接
http://localhost:5173/official-website/
2、程序的配置
3、nginx.conf配置
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name nju.nanjingaijia.com;
location /official-website {
alias /usr/share/nginx/admin/dist;
try_files $uri $uri/ index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
4、访问地址即可。
http://nju.nanjingaijia.com/official-website/#/home
此配置文件,可以配置纯前端的vue3的配置文件,可以不用后端的配置文件,不需要考虑后端,对于纯前端的项目和工程有一定的参考意义。