How to set up Magento 2.1.0 on Plesk with Nginx-only hosting option enabled

Follow

Comments

7 comments

  • Avatar
    Imesh Liyanage

    Hi, I'm getting the following error when trying to save the Additional nginx directives:

    Invalid nginx configuration: nginx: [emerg] "alias" directive is not allowed here

  • Avatar
    Mathilde Ferrier

    I've got this error after step 7

     

    Configuration Nginx non valide : nginx: [emerg] "alias" directive is not allowed here in /var/www/vhosts/system/kaiel-paris.com/conf/vhost_nginx.conf:38 nginx: configuration file /etc/nginx/nginx.conf test failed

     

  • Avatar
    Mathilde Ferrier

    Any help?

  • Avatar
    Alexandr Redikultsev

    Hi @Mathilde Ferrier and @Imesh Liyanage!

    There were some missing spaces and braces, thanks for pointing this out!

    I have fixed it. so now it should be fine.

    P.S. Just a tip: you can use notepad++ to replace all example.com with yourdomain.com with just one click!

  • Avatar
    Imesh Liyanage (Edited )

    Hi @Alexandr Shadrin, thanks that fixed the config issue.

    But when I try to go to any page other than the homepage of the Magento install, I'm just shown a 'File not found' error.

    Also I'm trying to set up a multi-store Magento with 2 domains, I put both these domains in 'add_header Access-Control-Allow-Origin' but when I try to go to the second domain it just redirects back to the first. Any idea why? I already have an alias setup in Plesk pointed to the same directory and it works fine with Apache.

  • Avatar
    Alexandr Redikultsev

    Hi, @Imesh Liyanage.

    I was not able to reproduce the issue on test server, added directives works properly for one Magento site. Maybe example.com was not fully replaced in the mentioned directives or virtual hosts are located not in /var/www/vhosts/? 

    As for the multi-store solution, I believe this directives are actual for one site only. I suggest getting in touch with Magento community in order to get the nginx directives for multi-store, and then convert them using the directives for one site provided in the article as an example.

  • Avatar
    Jerry van Kranenburg

    @Imesh Liyanage: I have exactly the same issue. Homepage works fine, other pages I get the "File not found" 

    Do you have this solved already?

Please sign in to leave a comment.

Have more questions? Submit a request