Paths
Added by Andy Z about 13 years ago
Working with nginx the name of spawned fcgi script appears in the uri path, i.e.
[2011-Dec-05 12:42:18.202913] 1960 [/Home.wt Bnp67HnvsPjbhbQG] [path] "/features"
So when hovered a web link shows the following reference in the status bar:
http://localhost/Home.wt/features
however when followed it changes, depending on the browser, to
http://localhost/features
or
http://localhost/#/features
in the address bar.
Obviously, neither of these addresses can be bookmarked or refreshed until script name is present in the path.
So the question is what would be the best way to get a uri free of script.
Replies (6)
RE: Paths - Added by Koen Deforche about 13 years ago
Hey Andy,
What version of Wt is that ?
Regards,
koen
RE: Paths - Added by Andy Z about 13 years ago
Howdy, Koen --- it's version 3.2.0 on Fedora 15 platform (nginx 1.0.9). Shall I try any other versions? ¶
Regards,
andy
RE: Paths - Added by Koen Deforche about 13 years ago
Hey Andy,
I'll try to reproduce this. To make sure that I understand, http://localhost/Home.wt/features is really the URL that you would expect as the portable url ?
Regards,
koen
RE: Paths - Added by Andy Z about 13 years ago
Hi, Koen --- ideally I would like to make it http://localhost/features . Certainly however I could live with something like http://localhost/wt/features . It could be a setting tweak as well, but the only point is which one :) ¶
Regards,
andy
RE: Paths - Added by Koen Deforche about 13 years ago
Hey,
I think the problem is that you need to specify in your nginx configuration the SCRIPT_NAME parameter (and others):
e.g. this is a sample nginx FastCGI configuration that works for me with the wt-homepage example:
location /wt {
fastcgi_pass 127.0.0.1:9091;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
if ($document_uri ~ "^/wt/(.*)") {
set $apache_path_info /$1;
}
fastcgi_param SCRIPT_NAME /wt;
fastcgi_param PATH_INFO $apache_path_info;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
}
RE: Paths - Added by Andy Z about 13 years ago
Hi, Koen --- yes, I've already set the 'SCRIPT_FILENAME $document_root$fastcgi_script_name;' param which is likely identical to 'SCRIPT_NAME /wt;' providing the script is named 'wt'. This however is not exactly what I needed. But as I understood now it's just another setting param I have to play with to get the desired result. I will look over the set again.
Thank you so much for your time. ¶
andy