• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Permission denied 403 Nginx Wordpress site migration

dmetallidis

New Pleskian
Hello,

Even though it is a common problem for many people and a lot of answers being given, I am still getting the error of "403 Forbidden" by ngnix.

The configuration file of my Nginx vhost is the following:

Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
    listen MY_IP:80;

    server_name mysite.name.com;
    server_name www.mysite.name.com;
    server_name ipv4.mysite.name.com;

    client_max_body_size 128m;

    root "/var/www/vhosts/mysite.name.com/httpdocs";
    access_log "/var/www/vhosts/system/mysite.name.com/logs/proxy_access_log";
    error_log "/var/www/vhosts/system/mysite.name.com/logs/proxy_error_log";

    #extension wp-toolkit begin

    #extension wp-toolkit end

    #extension letsencrypt begin
    location ~ ^/\.well-known/acme-challenge/ {
        root /var/www/vhosts/default/htdocs;

        types { }
        default_type text/plain;

        satisfy any;
        auth_basic off;
        allow all;

        location ~ ^/\.well-known/acme-challenge.*/\. {
            deny all;
        }
    }
    #extension letsencrypt end

    location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
        return 301 https://$host$request_uri;
    }

    location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
        alias /var/www/vhosts/mysite.name.com/web_users/$1/$2;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/mysite.name.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ \.php(/.*)?$ {
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/mysite.name.com/php-fpm.sock";
        include /etc/nginx/fastcgi.conf;

    }

    location ~ /$ {
        index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
    }

    add_header X-Powered-By PleskLin;

    include "/var/www/vhosts/system/mysite.name.com/conf/vhost_nginx.conf";
}

Please note that I have done the following:
  1. Changed the permission of files in 755 mode
  2. Added the user in both Plesk groups (psaserv, psacln)
  3. Restarted nginx

    Also, I have migrated WordPress database and is working just fine, as Plesk is able to scan that there is a WordPress installation.
Can you please elaborate as it is a common problem although with an uncommon solution :)
 
Make sure that the files and directories of the the website are owned by the user that is the main subscription user of the subscription.
 
Back
Top