P
P
protasovmikhail2019-02-13 14:15:42
Nginx
protasovmikhail, 2019-02-13 14:15:42

What is wrong with my nginx config?

Tries to give me a file on request - /, tried everything. On request - /index.php gives what is needed and works. I am attaching the config.
Bottom line - I can't redirect from / to /index..

listen 81 default_server;
  server_name phpmyadmin;
  #access_log /var/log/phpmyadmin.access_log;
  #error_log /var/log/phpmyadmin.error_log;

  root /usr/share/phpmyadmin/;
  index index.php index.html index.htm;

  #PhpMyAdmin
  location / {
    #try_files $uri loop;
    #try_files $uri $uri/ /index.php;
    index index.php;
                try_files $uri $uri/ /index.php/; #$args;
  }	

  auth_basic '';
        auth_basic_user_file /etc/nginx/.htpasswd;	
  
  location ~* \.php$
  {

    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include fastcgi_params;	
  }

  #location /
        #{
        #        try_files $uri $uri/ =404;
        #        try_files $uri $uri/ /index.php;
  #	index index.php;
  #	try_files $uri $uri/ /index.php/$args;
  #}


  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$
  {
    access_log off;
    log_not_found off;
    expires 1d;
  }

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question