Ask Your Question
1

serve askbot on nginx with uwsgi or gunicorn from subpath

asked 2012-07-22 13:02:31 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

updated 2012-07-22 13:02:31 -0500

gplaxico gravatar image gplaxico
1 1 1 4

Has anyone successfully served askbot from a subpath using nginx with uwsgi or gunicorn.

Main site: www.example.com Will have link to askbot forum: www.example.com/ask

On nginx trying to capture this seperately by doing

location /ask/ {
    proxy_set_header    X-Real-IP   $remote_addr;
    proxy_set_header    Host        $http_host;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;

    rewrite ^/ask/(.*)$ /$1 break;
    proxy_pass http://askbot;  #askbot is an upstream hook either gunicorn or uwsgi
    proxy_redirect http://askbot/ $scheme://$host/ask/;

No success. Tried other approaches, uwsgi SCRIPT_NAME cofiguration, etc... The closet one found was using nginx as a proxy and serving askbot from apache. Obviously, I'd like to have just nginx running and not have both apache and nginx running.

Why run from a subpath. Simple the main site will have links to other facets of the website. I don't it to be incorporated into the main site which are either django projects or other framework. Bottom line: it would be nice to be able to deploy separate from non-root location.

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-07-22 13:47:47 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

updated 2012-07-22 14:09:50 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

Try using FORCE_SCRIPT_NAME valiable in the settings.py file. This commit in Django supposedly fixed the issue back in 2008.

There is a more hackish workaround described in this blog post and a stackoverflow answer.

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-07-22 13:02:31 -0500

Seen: 237 times

Last updated: Jul 22 '12