How do I redirect to virtual directory in Ngnix?

Discussion in 'ISPConfig 3 Priority Support' started by concept21, Sep 9, 2021.

  1. concept21

    concept21 Active Member

    Hello,
    I am installing a very new Laravel php software. All files are placed under mydomain.tld/web/

    This software requires that when I browse to a virtual directory /install/, http://mydomain.tld/install, it should start the software automatically. But I only get 404 error.

    How do I correct it? Russian Bloc fans, please help me to solve it. :(
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Are the files owned by the web user?

    Any errors in the error.log for that web?
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Is your nginx web server http only? Does the software requires adding nginx snippets like WP or Joomla?
     
  4. concept21

    concept21 Active Member

    I have a Letsencrypt SSL for my vhost.
    No error in the log. I add a line in the vhost file as requested by the php script but it does not work out of box:

    Code:
    location / {
               try_files $uri $uri/ /index.php?$query_string;
            }
    
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Yes, sometime it does not work out of the box and you need to use the one that others claimed working instead, of which you have to research since we do not know what software you were talking about.

    Do try from https://mydomain.tld/install since you said you already has vhost with SSL for that domain.
     
  6. concept21

    concept21 Active Member

    It works after I append /public/ to web root web/ in Nginx vhost file. :rolleyes:
     
    ahrasis likes this.
  7. concept21

    concept21 Active Member

    As to hosting very heavy php software, Nginx vs Apache 2.4 is about the same.
     

Share This Page