laravel - phpmyadmin 显示 404 在 nginx 中找不到

标签 laravel ubuntu nginx

我部署了我的 laravel 应用程序,它工作正常。我的默认文件

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html/partex-star/public;

        # Add index.php to the list if you are using PHP
        index index.php  index.html index.htm index.nginx-debian.html;

        server_name 103.209.11.41;
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.php$is_args$args;
        }


        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
         }
}


然后我添加这些代码以通过 http://ip_address/PhpMyAdmin 访问我的 phpmyadmin。但现在,它显示 404 未找到。

       location /phpmyadmin {
                alias /usr/share/nginx/html/phpmyadmin;
                try_files $uri  @phpmyadmin;
                allow 103.209.11.41;
                deny  all;

                index index.php;
                location ~* \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
                        fastcgi_param SCRIPT_FILENAME $request_filename;
                        include fastcgi_params;
                }
        }

我已经创建了符号链接(symbolic link)。

最佳答案

你能用这个链接吗?它应该可以工作http://103.209.11.41/phpmyadmin/index.php

关于laravel - phpmyadmin 显示 404 在 nginx 中找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60134373/

相关文章:

php - 任何文件更改后 Laravel 连接重置

laravel - Laravel 公共(public)文件夹中的 web.config 文件有什么用

javascript - 为什么 jQuery 的 .change() 事件仅在单击鼠标右键时触发?

django - munin 运行 munin-cron 时无法复制内容

spring-boot - Nginx/SpringBoot/Kubernetes - 客户端 IP 的 X-Forwarded-For header

python-3.x - Nginx proxy_pass 到 docker 容器不起作用

php - Laravel 验证 json 数据

python - 安装python3-dev时出现的问题

MongoDB "Connection refused"错误

nginx - Docker:用于开发 "Https everywhere"的 LetsEncrypt