解决ueditor上传图片报Nginx 502 bad gateway问题

将项目部署在LNMP环境中,ueditor图片上传遇到502 bad gateway错误。尝试修改security.limit_extensions、配置文件路径等未果。最终在fastcgi.conf中添加配置并调整Uploader.class.php文件,成功解决问题。
摘要由CSDN通过智能技术生成

项目放到LNMP环境的服务器下,发现ueditor无法上传图片,最开始的问题是页面报“后端配置项没有正常加载,上传插件不能正常使用”。

当时Nginx的日志报的是:FastCGI sent in stderr: "Access to the script '/***/static/js/ueditor/php' has been denied (see security.limit_extensions)" while reading response header from upstream, client: ***, server: ***, request: "GET /static/js/ueditor/php/controller.php?action=config&&noCache=*** HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "***", referrer: "http://***/***.html"

百度过各种方法,包括修改ecurity.limit_extensions参数、Chongqing大小写问题、填写config.json绝对路径等等,均无变化。

后来重新修改了Nginx配置,在fastcgi.conf文件开头,添加以下

fastcgi_split_path_info       ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO       $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

重启生效,ueditor正常出现“点击选择图片”按钮。

好的,根据你提供的链接,我为你设计了一个登录界面的例子: ``` unit LoginForm; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type TLoginForm = class(TForm) Image1: TImage; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var LoginForm: TLoginForm; implementation {$R *.dfm} procedure TLoginForm.Button1Click(Sender: TObject); begin // 在这里编写登录验证的代码 // 如果验证通过,可以使用 MainForm.ShowModal; 打开主窗体 // 如果验证不通过,可以使用 ShowMessage() 方法弹出错误提示 end; procedure TLoginForm.Button2Click(Sender: TObject); begin Application.Terminate; end; procedure TLoginForm.FormCreate(Sender: TObject); begin // 设置窗体的标题和图标 Self.Caption := '登录 - OA系统'; Self.Icon.LoadFromFile('logo.ico'); end; end. ``` 这个例子中,我们使用了 TImage、TLabel、TEdit、TButton 等控件来实现登录界面。同时,我们还编写了 Button1Click 和 Button2Click 事件,在 Button1 被点击时验证用户输入的用户名和密码,并打开主窗体,如果验证不通过则提示错误信息;在 Button2 被点击时关闭窗体。 在 FormCreate 事件中,我们还设置了窗体的标题和图标。你可以根据自己的需求,修改这些属性来定制自己的登录界面。 希望这个例子能够对你有所帮助。如果你还有其他问题或需要进一步帮助,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值