Как установить phpMyAdmin с Nginx?

это зависит от Вашей конфигурации. Скорее всего, Вы включали что-то как

пользователь никто никого не группирует

в Вашей клиентской конфигурации. Побочный эффект этого состоит в том, что клиент не может восстановить старые маршруты, когда соединение умирает.

Без большей информации о Вашей установке невозможно сказать наверняка.

0
задан 15 October 2011 в 12:02
1 ответ

See an example from my setup:

server {
    listen 80;
    server_name domain.com;
    # Server root
    root /home/user/domain.com/public_html;
    index index.html index.php;

    location /MySQLAdmin {
        auth_basic "Restricted Access";
        auth_basic_user_file htpasswd_file;

        alias /usr/share/phpMyAdmin/;
        try_files $uri $uri/ @fastcgi;
    }
    location ~ .+\.php$ {
        # Return '400 Bad Request' for malformed URLs
        location ~ \..*/.*\.php$ {
            return 400;
        }
        # Map 418 error code (no bady uses) to fastcgi
        error_page 418 = @fastcgi;
        return 418;
    }
    location @fastcgi {
        fastcgi_pass 127.0.0.1:9000;
        ...
    }
    location / {
        try_files $uri $uri/ @fastcgi;
    }
}

Requests to "MySQLAdmin" will be handled by that location which is aliased to phpMyAdmin folder. Nginx will return static files directly and send PHP to @fastcgi. Requests to ".php" will be sent to @fastcgi.

Nginx tries to serves everything else and sends those not found to @fastcgi. Basically, static files will be served by Nginx. Index.php requests not explicit written out will not be found and passed to @fastcgi.

1
ответ дан 23 November 2019 в 11:04

Теги

Похожие вопросы