Nginx + phpmyadmin = not given to the static?

Hi, Habr!

About statics in General, the question beaten, solutions a lot. The problem is that I have not given it bolted from phpmyadmin from the site statics given.

config:
server {

listen 80;

root /home/user/www;

index index.php index.html index.htm;

include mime.types;

server_name localhost;

#location / {

# First attempt to serve request as file, then

# as directory, then fall back to index.html

#try_files $uri $uri/ /index.php;

#}

location ~ * ^.+\.(htm|html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {

root /home/user/www/;

}

location ~ * ^.+\.(htm|html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {

root /usr/share/phpmyadmin/;

}

location ^~ /phpmyadmin {

root /usr/share/phpmyadmin;

index index.php;

include fastcgi_params;

location 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;

}

location ~ .php$ {

location 127.0.0.1:9000;

fastcgi_index index.php;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME /home/user/www/$fastcgi_script_name;

}

location ~ /\.ht {

deny all;

}

}


rights to subdirectories
root@synclexpro:~# ls-lA /usr/share/phpmyadmin/themes

total 8

drwxrwxrwx 4 www-data root 4096 Mar 29 19:49 darkblue_orange

drwxrwxrwx 4 www-data root 4096 Mar 29 19:50 original


Ie ip_site/print.css will give, and ip_site/phpmyadmin/print.the css -> "access denied"

PS.

Know what to treat it is necessary the knowledge) I know how as yet)
October 8th 19 at 01:05
2 answers
October 8th 19 at 01:07
Solution
You have two of the same location, include common sense, knowledge is not necessary, move the phpmyadmin folder in the directory of the site if you do not know how variati nginx.
the time is now 3-50 am, so to answer your spirit, I will not. But all evening, while I was looking for a solution I kept in mind this is your answer with the offensive reference to "common sense". And to sort through why is it offensive I have no desire, want I write to the PM.
I'd rather describe the most recent phenomenon in IT, filled with the most "common sense", which got me a few days ago.
There are VPN, is registered with key -p in the route on the Windows client. VPN server periodically breaks the connection.
After reconnecting the remote resources are still not available, only a reboot helps.
However, if you go to the console from the administrator and ONCE again give the command to add the route after the error message that the route is ALREADY THERE — the remote appears.
Find in this "common sense". But without ambitions, "Yes I am, Yes I am!". The Russinovich will also find, take the time and find. But so immediately. Do not know how with the routing to work, and it is necessary to register routes SO...
I mean, that first year in IT and sometimes "common sense" in the works of different systems see the least.
For this, my friend, there's a Q&A. Especially when documentation is scarce, and time is a little short (and so it happened — the solution I found just now — at night).
ps.
God forbid that on your journey you come across as smaller entities like you. Offended for nothing.
pps for the Council to put in the directory thank you, in the future will be useful, I just wanted to be sure to understand how all the same to configure nginx itself to make him exactly the work I need. - Madison.Kreig commented on October 8th 19 at 01:10
Especially when documentation is scarce [http://vkurseweba.ru/files/nginx-doc.pdf]
Documentation, oddly enough, still is on the official website nginx.org - Ignatius.Fadel34 commented on October 8th 19 at 01:13
You know, very much it prostate, so I'm a little pobrozhu you.
You second herpolsheimer only in this topic which makes mysterious passes with his hands, assuming that the other person, once wrote in the Q&A, then he is a complete Berk.
That documentation can be presented in several sources, nothing is impossible, believe me. You can see for yourself, just open both documents in the last section. Moreover, the moment at the office.the website is not available faq. And about the convenience of keyword search (which can be done when you have one Doc using banal ctrl+f) I say nothing.
And it is scarce. Although, I admit that it is enough to solve my problem. - Madison.Kreig commented on October 8th 19 at 01:16
October 8th 19 at 01:09
I think the problem is here:
location ~ * ^.+\.(htm|html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
root /home/user/www/;
}
location ~ * ^.+\.(htm|html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
root /usr/share/phpmyadmin/;
}

Because
To find the location corresponding to the request, first checks locations defined using the prefix strings (prefix locations). Among them is searched for the best match. Then regular expressions are checked in the order they appear in the configuration file. The search of regular expressions terminates on the first match, and the corresponding configuration is used. If a match with a regular expression is not found, the configuration is the most specific prefix location.
nginx.org/ru/docs/http/ngx_http_core_module.html#location

I.e. the second location is generally not processed.

Find more questions by tags phpMyAdminHostingNginxSystem administration