WebFaction
Community site: login faq

Hello,

I currently have my website configured so I have a WordPress blog (at blog.ai-therapy.com), and some dynamic content served by web2py (at www.ai-therapy.com). This was pretty easy to set up - I just created two different applications in my.webfaction.com, with the www subdomain handled by a custom nginx & uwsgi application, and the blog subdomain handled by a 'wp' application. However, I would like to set it up so that the blog can be reached at:

www.domain.com/blog

Any ideas how I can do this? My problem is that the main site is served by nginx + uwsgi, but I guess I need the WordPress pages to be handled by something else. (FastCGI?) Is it possible for the same nginx server to send some requests to uwsgi, and some to FastCGI? My best guess is that I need to update my nginx.conf file (see below), but I have no idea how. Any suggestions would be appreciated!

Thanks a lot!

nginx.conf:

worker_processes  4;

events {
    worker_connections  1024;
}

http {
    access_log  /home/aicbt/logs/user/access_appname.log  combined;
    error_log   /home/aicbt/logs/user/error_appname.log   crit;

    include                mime.types;
    client_max_body_size   10m;
    default_type           application/octet-stream;
    gzip_static            on;
    gzip_vary              on;
    sendfile               on;
    tcp_nodelay            on;

    server {
        listen 19524;
        location ~* ^/(\w+)/static/ {
            root /home/aicbt/webapps/nginx_uwsgi_web2py/web2py/applications/;
        }
        location / {
            uwsgi_pass      127.0.0.1:9002;
            include         uwsgi_params;
        }
    }
}

asked 05 Jul '12, 14:58

AICBT
313
accept rate: 0%

edited 05 Jul '12, 14:59


This is done easily by mounting the "wp" application on your website record at a URL Path of "/blog", while having your normal nginx + uwsgi application mounted on the same website record at a URL Path of "/".

The front-end Nginx server will split incoming requests based on their URL Paths and route them to the correct application. You would not be making any changes to your private nginx.conf file.

permanent link

answered 05 Jul '12, 19:10

ryans ♦♦
5.0k73158
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×240
×185
×24
×17
×11

question asked: 05 Jul '12, 14:58

question was seen: 3,144 times

last updated: 05 Jul '12, 19:10

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM