nginx - phppgadmin - *1访问被规则禁止

jutyujz0  于 2022-11-21  发布在  Nginx
关注(0)|答案(1)|浏览(160)

我想设置phppgadmin,postgresql已经完成-通过以下this article完成
但我有nginx,
到目前为止,我做了以下配置:

ln -s /usr/share/phppgadmin /var/www


/etc/nginx/sites-available/phppgadmin

server{
    listen 85;
    server_name     pgadmin.mypage.com;
    root            /var/www/phppgadmin;
    index index.html index.html index.php;

    access_log      /var/log/phppgadmin/access.log;
    error_log       /var/log/phppgadmin/error.log;

    location / {
            allow   my_page_IP;
            deny    all;
    }
    location ~ /\.ht {
            deny all;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /var/www/phppgadmin$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
    }
 }

ln -s /etc/nginx/sites-available/phppgadmin /etc/nginx/sites-enabled/

service nginx restart

但我得到的是:

403 Forbidden

错误日志显示:

2015/03/21 18:06:14 [error] 16916#0: *1 access forbidden by rule, client: 188.194.97.247, server: pgadmin.mypage.com, request: "GET / HTTP/1.1", host: "my_page_IP:85"

何月道:

chmod -R 775 phppgadmin/ 
chown -R www-data:www-data phppgadmin/

但还是一样的403消息,我做错了什么?

iqjalb3h

iqjalb3h1#

访问被规则禁止意味着您在配置中设置的规则删除了对所需页面的访问。
请尝试删除每个位置上规则,以查看问题原因

相关问题