[GH-ISSUE #699] 奇怪的错误unexpected token Eof () on line 3, column 1 #354

Closed
opened 2026-02-26 12:08:05 +03:00 by kerem · 1 comment
Owner

Originally created by @JxiaoC on GitHub (Nov 4, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/699

当我使用下面这行nginx配置文件时,在保存过后,会给出保存完成的提示

proxy_cache_path /home/xiaoc/nginx_cache/test/cache levels=1:2 keys_zone=img_speed:50m inactive=60m max_size=100m;

server {
    server_name test.com;
    listen 1023;
}

image

但是当我点击右上角的高级模式,准备切换回普通模式的时候,会出现如下的报错提示

image

当我手动把第一行配置文件注释掉过后,又能正常保存了

image

  1. 我尝试过重新新建站点,并且完全手动输入配置文件,也会出现这个错误提示。
  2. 直接把之前的nginx配置文件复制过来,只要配置文件中有proxy_cache_path,就会有这个错误提示。
  3. 使用nginx -t可以正常通过校验(虽然截图上显示的禁用,但实际上在/etc/nginx/sites-enabled下是有test.conf这个文件的)

我用的是openresty,不知道和这个有没有关系,我的app.ini中的nginx配置如下

[nginx]
AccessLogPath   = /usr/local/openresty/nginx/logs/access.log
ErrorLogPath    = /usr/local/openresty/nginx/logs/error.log
LogDirWhiteList = /usr/local/openresty/nginx/logs/
ConfigDir       = /etc/nginx
PIDPath         = /usr/local/openresty/nginx/logs/nginx.pid
TestConfigCmd   = /usr/local/openresty/nginx/sbin/nginx -t
ReloadCmd       = /usr/local/openresty/nginx/sbin/nginx -s reload
RestartCmd      = /usr/local/openresty/nginx/sbin/nginx -s reload
Originally created by @JxiaoC on GitHub (Nov 4, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/699 当我使用下面这行nginx配置文件时,在保存过后,会给出保存完成的提示 ``` proxy_cache_path /home/xiaoc/nginx_cache/test/cache levels=1:2 keys_zone=img_speed:50m inactive=60m max_size=100m; server { server_name test.com; listen 1023; } ``` ![image](https://github.com/user-attachments/assets/4d29edc6-9ec7-4846-8c72-4db5f4203934) 但是当我点击右上角的`高级模式`,准备切换回`普通模式`的时候,会出现如下的报错提示 ![image](https://github.com/user-attachments/assets/e6fc0645-ba9f-414a-80e3-68b6b45a15cd) 当我手动把第一行配置文件注释掉过后,又能正常保存了 ![image](https://github.com/user-attachments/assets/4ad5d4b5-7126-49c7-b142-8751f459d2b1) 1. 我尝试过重新新建站点,并且完全手动输入配置文件,也会出现这个错误提示。 2. 直接把之前的nginx配置文件复制过来,只要配置文件中有`proxy_cache_path`,就会有这个错误提示。 3. 使用nginx -t可以正常通过校验(虽然截图上显示的`禁用`,但实际上在`/etc/nginx/sites-enabled`下是有`test.conf`这个文件的) > 我用的是`openresty`,不知道和这个有没有关系,我的`app.ini`中的`nginx`配置如下 ``` [nginx] AccessLogPath = /usr/local/openresty/nginx/logs/access.log ErrorLogPath = /usr/local/openresty/nginx/logs/error.log LogDirWhiteList = /usr/local/openresty/nginx/logs/ ConfigDir = /etc/nginx PIDPath = /usr/local/openresty/nginx/logs/nginx.pid TestConfigCmd = /usr/local/openresty/nginx/sbin/nginx -t ReloadCmd = /usr/local/openresty/nginx/sbin/nginx -s reload RestartCmd = /usr/local/openresty/nginx/sbin/nginx -s reload ```
kerem 2026-02-26 12:08:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Apr 14, 2025):

这个是我的锅,跟 gonginx 无关,已在 92dc61ec 修复,下个版本发布。

补充说明一下,rc.6 将会加入一个新的功能用于图形化配置 Proxy Cache,未来您可以直接在图形界面中修改 proxy_cache_path 的参数

Image
<!-- gh-comment-id:2800333932 --> @0xJacky commented on GitHub (Apr 14, 2025): 这个是我的锅,跟 gonginx 无关,已在 92dc61ec 修复,下个版本发布。 补充说明一下,rc.6 将会加入一个新的功能用于图形化配置 Proxy Cache,未来您可以直接在图形界面中修改 proxy_cache_path 的参数 <img width="1497" alt="Image" src="https://github.com/user-attachments/assets/d30ccaa2-4986-49ab-aefc-3851e6e636bf" />
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#354
No description provided.