Home nginx nginx causes access to Adminer SQL Web Administrator

nginx causes access to Adminer SQL Web Administrator

Author

Date

Category

In Nginx Newbie from the word kettle.
The task is to raise NGINX, on the path / admin redirect to the adminer (Adminer). Adminer – PHP file, located in the folder / admin / adminer.php folder. PHP server rises in it at 127.0.0.1:82, Adminer at this address works without a break.
NGINX works on LocalHost: 80 (there is a caching server that moves to Localhost: 81, which already distributes requests for destination points). Request Localhost: 80 / admin / admin.php normally redirects the Adminer page, but when you try to authorize, regardless of the correctness of the entered data, the error 403 (no access) is returned, with no errors (by type Login Failed for User ‘Admin’ As with an incorrect password) Adminer does not withdraw.

I do not understand what the problem may be.

nginx configuration file code:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/Modules-Enabled/c.conf;
Events {
  Worker_Connections 768;
  # Multi_accept ON;
}
http.
{
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  #Include /etc/nginx/conf.d/*conf;
  #include / etc / nginx / sites-enabled / *;
  Server
  {
    Listen Localhost: 80;
    location / admin /
    {
      proxy_pass http: // LocalHost: 82 /;
      proxy_no_cache 1;
    }
  }
  ##
  # Basic Settings
  ##
  #sendfile ON;
  #tcp_nopush on;
  #tcp_nodeLay ON;
  #keepalive_timeout 65;
  #types_hash_max_size 2048;
  # Server_Tokens Off;
  # server_names_hash_bucket_size 64;
  # server_name_in_redirect off;
  #Include /etc/nginx/mime.Types;
  #Default_Type Application / OcTet-Stream;
  ##
  # SSL settings
  ##
  #SSL_Protocols TLSV1 TLSV1.1 TLSV1.2 TLSV1.3; # Dropping SSLV3, REF: POODLE
  #SSL_Prefer_Server_ciphers ON;
  ##
  # Logging Settings
  ##
  ##
  # Gzip Settings
  ##
  Gzip ON;
  # GZIP_VARY ON;
  # Gzip_Proxied Any;
  # gzip_comp_level 6;
  # Gzip_Buffers 16 8K;
  # Gzip_Http_Version 1.1;
  # Gzip_Types Text / Plain Text / CSS Application / JSON Application / JavaScript Text / XML Application / XML Application / XML + RSS Text / JavaScript;
  ##
  # Virtual Host Configs
  ##
}

PHP server raise like this:

appeal directly works fine:

Screenshots of logs:
Error.log:

access.log:

Php Server Log:

p.s. I deleted the caching server and tried it right away from: 80 to forward to 82, but the effect did not give it. I updated the code nginx.conf in this matter.


Answer 1, Authority 100%

When you first request Localhost / Admin / a request for localhost is processed: 82 / adminer.php , but in the future any of the links / actions on the page calls appeal to the address On Beke localhost: 82 / admin / adminer.php , and of course there is no such page on a backend, therefore error 403 occurs.

How to fix?

You need to start the PHP server on the directory above (without fails to the Admin folder)

and in the config nginx Replace the string:

proxy_pass http: // localhost: 82 /;

on

proxy_pass http: // localhost: 82;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions