You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yudao/front-end/mall4v/nginx.conf

44 lines
1.8 KiB

2 months ago
# 定义一个server块它代表一个虚拟主机或站点。
server {
2 months ago
# 监听在HTTP标准端口80上这是未加密的HTTP流量的标准端口。
listen 80;
2 months ago
# 指定该服务器块响应哪些域名的请求。这里是mini-admin.mall4j.com。
server_name mini-admin.mall4j.com;
2 months ago
# 开启Gzip压缩功能以减少传输的数据量提高页面加载速度。
gzip on;
2 months ago
# 如果存在预压缩的静态资源(如.html.gz则优先提供这些压缩后的资源。
gzip_static on;
2 months ago
# 定义处理所有请求的location块。
location / {
2 months ago
# 尝试按照顺序查找文件:先找精确匹配的文件路径,然后是目录,最后尝试根路径。
try_files $uri $uri/ /;
2 months ago
# 设置Web根目录的位置即网站文件存放的目录。
root /usr/share/nginx/html/dist;
2 months ago
# 当访问根路径时,默认提供的首页文件名。
index index.html;
}
2 months ago
# 当出现404错误找不到页面重定向到指定的404错误页面。
error_page 404 /404.html;
2 months ago
# 特别指定当访问路径为/404-light.html时的处理方式。
location = /404-light.html {
# 这里没有额外配置,意味着它将按照默认规则处理此特定路径。
# 使用"="表示精确匹配只有当请求完全符合这个URL时才会触发。
}
2 months ago
# 对于500系列的服务器错误重定向到指定的50x错误页面。
error_page 500 502 503 504 /50x.html;
2 months ago
# 特别指定当访问路径为/50x.html时的处理方式。
location = /50x.html {
# 类似于上面的404-light.html配置这里也没有额外配置。
# "location = /50x.html"确保了只有当请求的是/50x.html时才会应用这个location块。
}
2 months ago
}