nginx 拒绝所有不适用于特定目录

nginx 拒绝所有不适用于特定目录

服务器正在运行 nginx。

可以访问 /meins/mymail 中的所有文件,但是为什么呢?

问候 Daniel

这是我的配置:

server {

    # SSL configuration
    #
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;

    ssl_certificate /etc/letsencrypt/live/www..de/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www..de/privkey.pem;

    root /var/www/www..de;

    index index.html index.php index.htm ;

    server_name www..de;

    location ~* /meins/mymail/
    {
            deny all;
    }


    location ~ \.php$
    {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$
    {
            expires 1M;
            access_log off;
            add_header Cache-Control "public";
    }

    location ~* \.(?:css|js)$
    {
            expires 1m;
            access_log off;
    }

    location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$
    {
            expires 1M;
            access_log off;
    }

    location /images
    {
            try_files $uri $uri/;
    }

    location /deins
    {
            try_files $uri $uri/ ;
    }

            location /
    {
            rewrite ^/([^/\.]+)/*([^/]*)/*([^/\.]*)/*.*$ /main.php?kkk=$1&aaa=$2&bbb=$3 last;
            rewrite ^.$ /main.php?kkk=Startseite last;
    }

}

相关内容