【问题标题】:restricted access on one of my pages in a site对网站中我的一个页面的访问受限
【发布时间】:2014-07-21 21:38:44
【问题描述】:

我正在拔头发来解决这个问题。我的站点中有一个页面,它总是要求输入用户名和密码,就好像它受到限制一样,这里是page。我设置了对我的另一个域 here 的受限访问。这是我的 nginx 配置文件:

server {
        listen          80;
        server_name     dev.shopious.com;
        client_max_body_size 25M;
        access_log      /var/log/nginx/dev.shopious.com.access_log;
        error_log       /var/log/nginx/dev.shopious.com.error_log warn;
        server_name_in_redirect off;
        root            /home/yanrizal/shopious-dev/web;
        location / {
                try_files $uri /app_dev.php?$args;
        }
        index           app_dev.php index.php index.html;
        fastcgi_index   index.php;

        location ~ \.php($|/) {
                 set  $script $uri;
                set  $path_info "";

                if ($uri ~ "^(.+\.php)(/.*)") {
                        set  $script     $1;
                        set  $path_info  $2;
                }
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                include /etc/nginx/fastcgi_params;
                keepalive_timeout 0;
                fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_pass    127.0.0.1:9000;

        }

        auth_basic              "Restricted";
        auth_basic_user_file    /etc/nginx/htpasswd;

        location ~* \.(js|css)$ {
                expires 1d;
                log_not_found off;
        }

        location ~* \.(png|jpg|jpeg|gif|ico)$ {
                expires 1y;
                log_not_found off;
        }
    }

为什么如果我删除此配置文件上的限制,它也会解决此特定页面上的限制问题?此站点上的所有其他页面均不受限制,仅此特定页面

【问题讨论】:

    标签: php symfony nginx


    【解决方案1】:

    您正在尝试从您的开发站点加载图像:

    http://dev.shopious.com/bundles/shopiousmain/img/mau-daftar/Shopious-Desktop-3-foto-kategori.png
    

    请注意标题为:ONLINE SHOPPERS YANG NGGA PAKE ...

    的部分中缺少的图像

    另外,如果你在 chrome 中打开开发工具并查看控制台,你会看到错误

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-09
      • 2017-12-11
      • 2020-05-05
      • 1970-01-01
      • 2019-01-15
      • 2017-02-27
      • 1970-01-01
      相关资源
      最近更新 更多