瑞芯微Linux nginx 配置

直接修改nginx的默认首页的配置。
sudo nano /etc/nginx/sites-enabled/default

server {
	listen 0.0.0.0:80 default_server;
	root /home/kickpi/dist;
	index index.html;
	server_name mixx12.local 192.168.70.14;
	location / {
	    try_files $uri $uri/ index.html;
            # 禁用ETag(减少资源验证耗时)
            etag off;
            # 关闭日志(嵌入式减少IO消耗)
            access_log off;
            error_log off;
	}
    # 去掉重复的text/html,保留其他压缩类型(可以不用)
    gzip on;
    gzip_types text/css application/javascript image/jpg image/png;
    client_max_body_size 10M;
}

重新验证配置

bash
sudo nginx -t
# 正常输出:
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful

然后shell环境执行 systemctl enable nginx。一般直接就成功了,作用是让nginx开机自启动
然后我们去 /etc/xdg/xfce4,修改 xinitrc 文件。
把几乎最底下的一个exec xfce4-session注释掉
改成chromium的启动命令,记得带参数。这样就可以跳过桌面直接启动浏览器并打开指定页面了。

posted @ 2026-01-28 14:33  yepcraft  阅读(8)  评论(0)    收藏  举报