使用Nginx 建立自己的图片图床

发布时间 2023-10-10 13:34:17作者: Arcturis

第一步在 nginx html 目录下建立imgs文件夹

然后 修改 conf 下的 nginx.conf文件 新增 如下 server模块

  server {
        listen       8082;
        server_name  ip;

        location / {

            if ($request_method = 'OPTIONS') {
                return 204;
            }

            root   html/imgs;
            # index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

ip 端口换成你自己的ip 端口 ,重启 nginx即可