可以使用以下 NGINX 配置实现:

server {
    listen 80;
    server_name example.com;

    location /1 {
        try_files /a.html =404;
    }
}

这个配置将 NGINX 配置为监听端口 80,并将所有访问 /1 的请求重定向到文件 'a.html' 的内容。如果文件 'a.html' 不存在,则返回 404 错误。

NGINX 配置访问 /1 路径,输出文件 a.html 内容

原文地址: https://www.cveoy.top/t/topic/n4i0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录