0
我有我的phpMyAdmin設置如下。這在站點的默認服務器塊(可用和啓用站點)內。NGINX更改位置塊內的phpMyAdmin端口
如何在位置塊或某個位置將端口更改爲8003而不影響端口80的功能?
server{
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
[..........]
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
[..........]
}
該死的,希望這是可能的....一個更好的方式來確保phpmyadmin? – Anup
在不同的端口上收聽不會比改變URL更安全,如果你願意,你可以這樣做。否則,您可以爲該位置激活HTTP認證:http://wiki.nginx.org/HttpAuthBasicModule –