Phpmyadmin-502 Bad Gateway nginx / 1.14.0(Ubuntu)

时间:2019-06-19 07:13:28

标签: nginx phpmyadmin nginx-config

我正在使用AWS EC2,在那里我将Nginx Web服务器用于Node App。

这是我设置服务器块的方法:

server {

        server_name example.com www.example.com;
        root /var/www;
        index index.php index.html index.htm;
        location / {
                proxy_pass    http://localhost:3001;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }

        location /pma/ {
                try_files $uri $uri/ /index.php;

                location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
                        access_log        off;
                        expires           360d;
                }
        }


        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                include fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
        }

        location ~ /\.ht {
                deny all;
        }

}









我的phpmyadmin位于/var/www/目录中!

问题是当我尝试登录到phpmyadmin时,如下所示:

example.com/phpmyadmin

我被显示502 Bad Gateway nginx/1.14.0 (Ubuntu)错误

但是,如果我尝试访问example.com/phpmyadmin/index.php

它加载了,但显示的页面坏了!

我什至尝试通过服务器Ip登录。还是我不能。

有人可以帮助我吗?

0 个答案:

没有答案