lundi 27 juin 2016

Nginx + phpMyAdmin Login 404 not found

I am running Nginx on a Raspbian Jessie Lite and already got phpMyAdmin to work. I set up a virtual host for port 8080 and used mostly this tutorial to set up phpMyAdmin: pestmeester.nl. I can access phpmyadmin login site via "Ip-Adress:8080/phpmyadmin". When I login with my username and password I get redirected to a "404 not found" page. However, when I go back to "Ip-Adress:8080/phpmyadmin" I am in the phpMyAdmin interface and can work normally with PMA.

URL of 404 page: 192.168.178.29:8080/index.php?token=43eb901091bfce602f12f65c93c60bfc&phpMyAdmin=d89uads0j249a7oqnml360cs4svj3j9q URL of working page: 192.168.178.29:8080/phpmyadmin/#PMAURL-0:index.php?db=&table=&server=1&target=&token=43eb901091bfce602f12f65c93c60bfc

I just want to know what is going wrong during login process and if I can fix this minor bug? I am very new to Nginx and Webservers in general so it may be a simple misconfiguration. I will post my virtual host configuration file first. If there is anything else you will need just say.

server {
  listen 8080;

  root /var/www/html/jpc;

  server_name youdontneedtoknow;

  error_log /var/www/html/jpc/logs/error.log error;
  access_log /var/www/html/jpc/logs/access.log;

  location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
  }

  # Enable PHP Support
  #
  location ~ .php$ {
    # SECURITY : Zero day Exploit Protection
    # Won't work properly (404 error) if the file is not stored on this server, wh$
    # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another m$
    try_files $uri =404;
    # Enable PHP, listen fpm sock
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }

  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  location ~ /.ht {
    deny all;
  }

  # phpMyAdmin
  #
  location /phpmyadmin {
    root /usr/share/;
    index index.php index.html index.htm;
    location ~ ^/phpmyadmin/(.+.php)$ {
      root /usr/share/;
      #include fastcgi-gen.conf;
      fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include /etc/nginx/fastcgi_params;
      fastcgi_buffer_size 128k;
      fastcgi_buffers 256 4k;
      fastcgi_busy_buffers_size 256k;
      fastcgi_temp_file_write_size 256k;
      fastcgi_read_timeout 240;
    }
    location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
      root /usr/share/;
    }
  }
  location /phpMyAdmin {
    rewrite ^/* /phpmyadmin last;
  }
}

Aucun commentaire:

Enregistrer un commentaire