js和css使用本地相对路径
This commit is contained in:
55
web_page/nginx.conf
Normal file
55
web_page/nginx.conf
Normal file
@@ -0,0 +1,55 @@
|
||||
# Nginx配置文件 - 监控大屏系统
|
||||
server {
|
||||
listen 8093;
|
||||
server_name localhost;
|
||||
|
||||
# 设置字符编码
|
||||
charset utf-8;
|
||||
|
||||
# 设置根目录
|
||||
root /path/to/your/FaceRecognitionWithInsightFace/web_page;
|
||||
|
||||
# 默认首页
|
||||
index index.html monitor_dashboard.html;
|
||||
|
||||
# 主页面服务
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
# 设置MIME类型
|
||||
types {
|
||||
text/html html htm;
|
||||
text/css css;
|
||||
application/javascript js;
|
||||
image/png png;
|
||||
image/jpeg jpg jpeg;
|
||||
image/gif gif;
|
||||
image/svg+xml svg;
|
||||
}
|
||||
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
# 缓存设置
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
|
||||
# 静态资源目录(如果有的话)
|
||||
location /static/ {
|
||||
alias /path/to/your/FaceRecognitionWithInsightFace/web_page/static/;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# 错误页面
|
||||
error_page 404 /404.html;
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
# 日志设置
|
||||
access_log /var/log/nginx/monitor_dashboard_access.log;
|
||||
error_log /var/log/nginx/monitor_dashboard_error.log;
|
||||
}
|
||||
Reference in New Issue
Block a user