Plesk禁止403获得引导风格(nginx)

时间:2018-05-26 16:18:49

标签: codeigniter nginx plesk httpforbiddenhandler

我在主机上安装了PLESK,并创建了一个子域“app.mysite.com”。在这个子域中,我使用以下结构上传我的codeigniter proyect:

enter image description here

当我尝试访问“css”文件夹以获取boostrap.min.css文件(app.mysite.com/css/bootstrap/css/bootstrap.min.css)时,我收到此禁止错误: enter image description here

这是此站点的HTTP的附加指令: enter image description here

另一个用于HTTPS: enter image description here

此网站会自动从HTTP重定向到HTTPS。

要完成,我将此代码添加到其他nginx指令: enter image description here

其他测试

我尝试更改“附加nginx指令”,从URL中删除index.php: enter image description here

但是没有加载样式文件,并且codeigniter读取url作为控制器调用返回“404找不到页面”:

enter image description here

请,我需要有关此问题的帮助以及如何正确配置nginx以访问css /,js /和img / folders文件。 谢谢

/修改

我找到了app.mysite.com子域名的nginx.conf文件:

    #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 206.189.5.184:443 ssl http2;

            server_name app.mysite.com;
            server_name www.app.mysite.com;
            server_name ipv4.app.mysite.com;

            ssl_certificate             /opt/psa/var/certificates/scfMQnEev;
            ssl_certificate_key         /opt/psa/var/certificates/scfMQnEev;
            ssl_client_certificate      /opt/psa/var/certificates/scfcJsJQ3;

            client_max_body_size 128m;

            root "/var/www/vhosts/mysite.com/app.mysite.com";
            access_log "/var/www/vhosts/system/app.mysite.com/logs/proxy_access_ssl_log";
            error_log "/var/www/vhosts/system/app.mysite.com/logs/proxy_error_log";

            location / {
                    proxy_pass https://206.189.5.184:7081;
                    proxy_set_header Host             $host;
                    proxy_set_header X-Real-IP        $remote_addr;
                    proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                    access_log off;

            }

            location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
                    proxy_pass https://206.189.5.184:7081;
                    proxy_set_header Host             $host;
                    proxy_set_header X-Real-IP        $remote_addr;
                    proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                    access_log off;

            }
            location @fallback {
                    proxy_pass https://206.189.5.184:7081;
                    proxy_set_header Host             $host;
                    proxy_set_header X-Real-IP        $remote_addr;
                    proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                    access_log off;

            }

            location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|ra$
                    try_files $uri @fallback;
            }

            location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
                    alias /var/www/vhosts/mysite.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/app.mysite.com/php-fpm.sock";
                    include /etc/nginx/fastcgi.conf;

            }

            location ~ ^/~(.+?)(/.*)?$ {
                    proxy_pass https://206.189.5.184:7081;
                    proxy_set_header Host             $host;
                    proxy_set_header X-Real-IP        $remote_addr;
                    proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                    access_log off;

            }

            location ~ \.php(/.*)?$ {
                    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                    fastcgi_param PATH_INFO $fastcgi_path_info;
                    fastcgi_pass "unix:///var/www/vhosts/system/app.mysite.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/app.mysite.com/conf/vhost_nginx.conf";
    }

    server {
            listen 206.189.5.184:80;

            server_name app.mysite.com;
            server_name www.app.mysite.com;
            server_name ipv4.app.mysite.com;

            client_max_body_size 128m;

            return 301 https://$host$request_uri;
    }

0 个答案:

没有答案