Hello there.I'm writing a web program using java, ckeditor and nginx. Everything is work ok without nginx's reverse proxy, but I need nginx to load static files, and the problems is coming. This is the way I init ckeditor:
<textarea name="editor1" id="editor1"></textarea>
CKEDITOR.replace('editor1', {
height: 400,
filebrowserUploadUrl: "ckeditorupload.htm"
});
And the nginx config about proxy_pass :
upstream glassfish {
server 127.0.0.1:8080;
}
server {
listen 9000;
server_name localhost;
location /web/ {
proxy_pass http://glassfish;
}
location /web/res/ {
alias /Users/****/Documents/****/;
}
}
The function I want is :
"localhost:9000/web/res/****.jpg" -> "/Users/****/Documents/****/****.jpg"
"localhost:9000/web/****" -> "localhost:8080/web/****"
So, in this case, when the upload button clicked, a request with url "localhost:9000/web/ckeditorupload.htm" should post to "localhost:8080/web/ckeditorupload.htm", which it didn't, and I got 404 error by nginx. However, if I send request use command line with code "$.ajax({url:"ckeditorupload.htm"});" that will be worked. I don't known what's wrong with the request send by ckeditor and I don't known how to debug it.(BTW, show me a way to log the real url proxy_pass by nginx, please.)
It's the problem cause by domain? webroot? Help, please. Thank you very much in advance!