nginx proxy_pass problem with “no root” content

  • Unknown's avatar

    Dear all,

    i have the following problem.

    i have installed 2 blogs on a dedicated server (blog only). the blogs are installed in the folder
    – /var/www/blog/en
    – /var/www/blog/de

    the blogs are called via proxy_pass from an other server. Therefore i have introduced the 2 subdomains.As you can see here:

    http://www.twago.com/blog
    http://www.twago.de/blog

    the problem is for all content that is not coming from the database like images etc. or also /wp-admin/ call the subdomain is used. if you look at the sourcecode of the page for all folders below /blog/de the subdomain is in the link and not http://www.twago.com/blog… i dont know what to do.

    Heres my nginx – config from the server thats calling the proxy_pass:

    location /blog/ {
    # If logged in, don’t cache.
    if ($http_cookie ~* “comment_author_|wordpress_(?!test_cookie)|wp-postpass_” ) {
    set $do_not_cache 1;
    }
    proxy_cache_key “$scheme://$host$request_uri $do_not_cache”;

    proxy_pass_header Set-Cookie;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    #sub_filter_once off;
    sub_filter ‘blog-en.twago.com’ ‘www.twago.com/blog’;
    proxy_pass http://80.237.207.10;
    }

    my nginx settings on the dedictated blog server

    server {
    listen 80.237.207.10:80;
    server_name blog-en.twago.com;

    location / {
    root /var/www/blog/en;
    index index.php;

    if (!-e $request_filename) {
    rewrite ^.+/?(/wp-.*) $1 last;
    rewrite ^.+/?(/.*.php)$ $1 last;
    rewrite ^(.+)$ /index.php?q=$1 last;
    }

    Thanks already!

  • Unknown's avatar

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

  • The topic ‘nginx proxy_pass problem with “no root” content’ is closed to new replies.