我需要设置的位置让你的帮助没有工作的ip,Nginx的位置让预期
location /route {
deny [my-ip];
}
所以这个作品,它不会让我访问路线
抛出这个错误
403 Forbidden
nginx/1.10.0 (Ubuntu)
这...
location /route {
allow [my-ip];
deny all;
}
不会让我的访问,但它应该让我访问路线,不明白为什么,它表明这个错误
404 Not Found
nginx/1.10.0 (Ubuntu)
配置文件(航线上两个例子):
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
server_name [my-domain];
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
# Phpmyadmin Configurations
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_param HTTPS on; # <-- add this line
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.
(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
# Dealing with the uppercased letters
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
location /logs {
deny [myip];
}
location /admin {
allow [myip];
deny all;
}
什么叫“不允许你访问路线”呢? –
它显示了这404未找到 的nginx/1.10.0(Ubuntu的) – Janva
您可以共享一个更详细的conf文件? –