Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

奇怪的错误unexpected token Eof () on line 3, column 1 #699

Open
JxiaoC opened this issue Nov 4, 2024 · 3 comments
Open

奇怪的错误unexpected token Eof () on line 3, column 1 #699

JxiaoC opened this issue Nov 4, 2024 · 3 comments
Labels
bug Something isn't working gonginx This issue is related to the dependency gonginx

Comments

@JxiaoC
Copy link

JxiaoC commented Nov 4, 2024

当我使用下面这行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
@JxiaoC JxiaoC added the bug Something isn't working label Nov 4, 2024
@0xJacky
Copy link
Owner

0xJacky commented Nov 4, 2024

跟 openresty 没啥关系,这个应该是我们用 gonginx 解析器的 bug,但是很遗憾的是,有关 gonginx 的问题目前处理会暂缓

@0xJacky
Copy link
Owner

0xJacky commented Nov 4, 2024

你可以先将这个命令放到 nginx.conf 里,这样解析器不会处理这一行,这样暂时能用起来

@JxiaoC JxiaoC closed this as completed Nov 4, 2024
@0xJacky 0xJacky reopened this Nov 4, 2024
@0xJacky
Copy link
Owner

0xJacky commented Nov 4, 2024

不要关闭,这个问题后续会跟进

@Hintay Hintay added the gonginx This issue is related to the dependency gonginx label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gonginx This issue is related to the dependency gonginx
Projects
Status: Done
Development

No branches or pull requests

3 participants