Как сделать перенаправление с корневой точки в nginx, не запрещая доступ к подкаталогам?

Bash не использует vfork , а bash огромен.

Это приводит к тому, что многие вилки занимают много виртуальной памяти.

Это, скорее всего, проблема, вызванная реальными ресурсами памяти в системе, а не тем, что вы можете контролировать с помощью ulimit .

Вы пробовали использовать Bourne Shell или ksh93? Оба используют vfork () для оптимизации производительности.

0
25.01.2018, 20:30
1 ответ

Давайте разделим вашу конфигурацию с помощью независимых директив «местоположения»:

# location for pure root path with trailing EOL
location ~ ^/$ {
    # Redirect only when we have no one
    # argument like www.example.com/?user=name for example 
    if ($is_args = "") {
        rewrite ^/$ /rootWiki/ redirect; 
    }
}

# After above "location" directive you can use even
# static files for the root path or subfolders.
# For examle:
# www.example.com/index.html
# www.example.com/user/general.html
location / {
    root /var/www/www.example.com/static/;
    index index.html;
}

location ^~ /rootWiki/ {
    resolver 127.0.0.1 valid=300s;
    access_log./logs/RootWiki_access.log;
    error_log./logs/RootWiki_error.log;
    proxy_buffers 16 4k;
    proxy_buffer_size 2k;
    proxy_set_header Host $host;
    proxy_set_header X-Real_IP $remote_addr;
    rewrite /rootWiki/(.*) /$1 break;
    proxy_pass http://192.168.1.200:8080;
}

location ^~ /usmle/ {
    access_log./logs/usmle_access.log;
}
0
28.01.2020, 04:32

Теги

Похожие вопросы