Subdomain Nginx rewrites

Discussion in 'ISPConfig 3 Priority Support' started by ktownmods, Oct 8, 2019.

  1. ktownmods

    ktownmods Member HowtoForge Supporter

    Hey, how can i use nginx rewrites on a subdomain? (Subdomain for website and not vor Vhost)

    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Put them in the nginx directives field of the website.
     
  3. ktownmods

    ktownmods Member HowtoForge Supporter

    Yeah, but how?
    in my directives is location/ {
    .......
    }
    but how to write it, that it is for forum.domain.tld?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Locations are paths behind the domain, so the domain is not relevant here as you can only have one file in the same location anyway. If you need different locations, then your two cms or forum systems that you put in the website should probably not be installed into the same website, create two different websites for them.
     
  5. ktownmods

    ktownmods Member HowtoForge Supporter

    Done, by adding it to the
    Code:
    location /forum {
        ...
    }
     
    Last edited: Oct 8, 2019
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so your forum is reachable under forum.yourdomain.tld/forum/ then when you installed it in a subfolder named forum. In this case, you must set a location for /forum/ instead of /. But I would have used two websites, this is cleaner and more secure, or at least a vhost subdomain
     
  7. ktownmods

    ktownmods Member HowtoForge Supporter

    The problem is, that the cms and the forum have to be on the same domain for updating them (because the cms update also the forum)

    Is there a way, to use a subdomain vhost in the folder forum from domain.tld?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that's the purpose of a vhost subdomain.
     
  9. ktownmods

    ktownmods Member HowtoForge Supporter

    Is it right, that i have to put in subdomain vhost web folder: web/forum that it use the forum folder from the domain.tld?

    So that works, but now i have this problem:


    Code:
    PHP message: PHP Fatal error:  require_once(): Failed opening required '../global.php' (include_path='.:/usr/share/php') in /var/www/clients/client0/web1/web/forum/global.php on line 13" while reading response header from upstream, client: 2003:f8:7bcb:XXXX:cd55:XXXX:ee19:6880, server: forum.samfreaks.de, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.2-fpm/web50.sock:", host: "forum.domain.de", referrer: "https://forum.domain.de/"
    
     
    Last edited: Oct 8, 2019

Share This Page