Greetings,

I have my application split into two parts so that I can soon run the two processes on different machines. I am trying to use the http-socket and internal router (apache2 is acting as reverse proxy). My goal is to have one of the paths get rerouted (as http) to the remote uwsgi.

The webserver config is:

;uWSGI instance configuration
[uwsgi]
emperor-fd = 7
ini = flask_server.ini
http-socket = 127.0.0.1:6767
route = ^/json_rpc_search uwsgi:127.0.0.1:9900
base_web_dir = /website/drugsite-test.msi.umn.edu
mongrel_dir = /website/drugsite-test.msi.umn.edu/mongrel2
uwsgi_dir = /website/drugsite-test.msi.umn.edu/uwsgi
cctbx_base_dir = /website/drugsite-test.msi.umn.edu/local/src
procname-prefix-spaced = DrugSite TEST Flask App
virtualenv = /website/drugsite-test.msi.umn.edu/.virtualenvs/test_drugsite_40
auto-procname = True
show-config = True
master = True
module = DrugSite_app:app
plugins = router_redirect
threads = 4chdir = /website/drugsite-test.msi.umn.edu/mongrel2
logto = /website/drugsite-test.msi.umn.edu/uwsgi/log/flask_server.log
cctbx_sources_dir = /website/drugsite-test.msi.umn.edu/local/src/cctbx_sourcescctbx_build_dir = /website/drugsite-test.msi.umn.edu/local/src/cctbx_build env = VIRTUAL_ENV=/website/drugsite-test.msi.umn.edu/.virtualenvs/test_drugsite_40
env = BASE_WEB_DIR=/website/drugsite-test.msi.umn.edu
env = PYTHONPATH=/website/drugsite-test.msi.umn.edu/.virtualenvs/test_drugsite_4
0/lib/python2.6/site-packages:/website/drugsite-test.msi.umn.edu/local/src/cctbx_sources:/website/drugsite-test.msi.umn.edu/local/src/cctbx_sourcesPyCifRW:/website/drugsite-test.msi.umn.edu/local/src/cctbx_sources/boost_adaptbx:/website/drugsite-test.msi.umn.edu/local/src/cctbx_sources/libtbx/pythonpath:/website/drugsite-test.msi.umn.edu/local/src/cctbx_build/lib
env = LIBTBX_BUILD=/website/drugsite-test.msi.umn.edu/local/src/cctbx_build
;end of configuration

*** Starting uWSGI 1.2.5 (64bit) on [Mon Aug 27 07:18:24 2012] ***
<snip>
uwsgi socket 0 inherited INET address 127.0.0.1:6767 fd 3

The computational node config is:

;uWSGI instance configuration
[uwsgi]
emperor-fd = 6
ini = search_server.ini
base_web_dir = /website/drugsite-test.msi.umn.edu
mongrel_dir = /website/drugsite-test.msi.umn.edu/mongrel2
uwsgi_dir = /website/drugsite-test.msi.umn.edu/uwsgi
socket = 127.0.0.1:9900
plugins = drugsite_search
auto-procname = True
procname-prefix-spaced = Lore Search
spooler = /website/drugsite-test.msi.umn.edu/mongrel2/search_spool
show-config = True
master = True
post-buffering = 8192
chdir = /website/drugsite-test.msi.umn.edu/mongrel2
env = DRUGSITE_CONFIG=/website/drugsite-test.msi.umn.edu/mongrel2/drugsite.sqlit
e3
env = VIRTUAL_ENV=/website/drugsite-test.msi.umn.edu/.virtualenvs/test_drugsite_
40
logto = /website/drugsite-test.msi.umn.edu/uwsgi/log/search_server.log
;end of configuration
*** Starting uWSGI 1.2.5 (64bit) on [Sat Aug 25 23:29:41 2012] ***
<snip>
uwsgi socket 0 inherited INET address 127.0.0.1:9900 fd 3

Both uwsgi instances + emperor are running on the same machine. When I try to connect to the route /json_rpc_search using http://localhost:6767/json_rpc_search (from the Flask app) or use a web browser I get an HTTP 404 error.

The following is what is written to the log for uwsgi running the Flask app
[uWSGI DEBUG] called 0x7fdfc2b1dd90 0x1fd86c8 1
calling close() for /json_rpc_search 0x1a5c870 0x7fdfc2bb2050
[pid: 16225|app: 0|req: 69/68] 127.0.0.1 () {26 vars in 348 bytes} [Mon Aug 27 07:20:25 2012] POST /json_rpc_search => generated 238 bytes in 2 msecs (HTTP/1.0 404) 2 headers in 72 bytes (1 switches on core 3)

Nothing is written to the log for the remote app. It seems to me that I do not have the route setup correctly or maybe the two uwsgi instances cannot communicate as configured. Are there any suggestions about how to debug this? (Note: both processes work as expected when I have mongrel2 do the routing using zmq, all that I changed is to have the uwsgi processes use http-socket and socket + internal router).

I tried fiddling with configs such as not loading the router_redirect plugin, using http-socket on the remote uwsgi process, etc., but the information written to the logs stays the same. This is why I am thinking that I am not routing the request correctly.

Also, the server running at 127.0.0.1:9900 has a custom plugin written for json-rpc using XHR. Sending a json-rpc POST directly to 127.0.0.1:9900 works as expected, but I want to have the uwsgi process running on 127.0.0.1:6767 to forward/route all urls starting with /json_rpc_search to 127.0.0.1:9900.

--Jeff
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to