Project

General

Profile

Hosting with nginx, spawn-fcgi; nothing displayed in browser

Added by Matt Kingston over 12 years ago

Hi there,

I'm trying to run my wt application under nginx/fcgi on Ubuntu Server 12.10. My page works fine on the built-in http server; but displays nothing at all when I use fcgi. I can also use proxy_pass in nginx and serve up the page fine. It does appear however that some source is sent to the browser (looking in view source); but nothing is displayed. I've test in both Firefox and Chrome. My Nginx config and the wt output are below.

Note that to confirm this isn't a problem with my code, I've compiled the hello example as follows:

@

g hello.C -lwt -lwtfcgi -lboost_signals

@

And I get the same result as presented below.

I'm not even sure where to start diagnosing this. Any suggestions would be greatly appreciated, as usual! Thanks in advance.

Nginx config:

@

location /fbtestadmin/ {

fastcgi_pass 127.0.0.1:9092;

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 ~ "/fbtestadmin/(.*)") {

set $apache_path_info /$1;

}

fastcgi_param SCRIPT_NAME /fbadminfcgi;

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;

}

@

Command-line output:

@

sudo spawn-fcgi -a 0.0.0.0 -p 9092 -n --- fbadminfcgi ---docroot .

[2013-Mar-03 13:31:14.664947] 3004 - [info] "WServer/wtfcgi: initializing relay server"

[2013-Mar-03 13:31:14.665679] 3004 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = 'fbadminfcgi')"

[2013-Mar-03 13:31:14.666180] 3004 - [info] "wtfcgi: spawned session process: pid = 3005"

[2013-Mar-03 13:31:14.666322] 3004 - [info] "wtfcgi: reading FastCGI stream from stdin"

[2013-Mar-03 13:31:14.676657] 3005 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = 'fbadminfcgi')"

[2013-Mar-03 13:31:14.677074] 3005 - [info] "Auth.GoogleService: not configured: OAuth: no 'google-oauth2-redirect-endpoint' property configured"

[2013-Mar-03 13:31:14.677116] 3005 - [info] "WServer/wtfcgi: initializing shared wtfcgi session process"

[2013-Mar-03 13:31:19.116583] 3005 - [info] "Wt: session created (#sessions = 1)"

[2013-Mar-03 13:31:19.116851] 3005 [/fbadminfcgi wvCB4bNvrOxtlUhx] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17"

[2013-Mar-03 13:31:19.117975] 3005 [/fbadminfcgi wvCB4bNvrOxtlUhx] [info] "WebRequest: took 1.598ms"

[2013-Mar-03 13:31:29.126603] 3005 [/fbadminfcgi wvCB4bNvrOxtlUhx] [info] "WebController: timeout: expiring"

[2013-Mar-03 13:31:29.126765] 3005 [/fbadminfcgi wvCB4bNvrOxtlUhx] [info] "Wt: session destroyed (#sessions = 0)"

[2013-Mar-03 13:31:31.577723] 3005 - [info] "Wt: session created (#sessions = 1)"

[2013-Mar-03 13:31:31.577842] 3005 [/fbadminfcgi ng8j4ASBPUSlQwKK] [info] "WEnvironment: UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0"

[2013-Mar-03 13:31:31.578221] 3005 [/fbadminfcgi ng8j4ASBPUSlQwKK] [info] "WebRequest: took 0.688ms"

[2013-Mar-03 13:31:41.585339] 3005 [/fbadminfcgi ng8j4ASBPUSlQwKK] [info] "WebController: timeout: expiring"

[2013-Mar-03 13:31:41.585483] 3005 [/fbadminfcgi ng8j4ASBPUSlQwKK] [info] "Wt: session destroyed (#sessions = 0)"

@