Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

Аналог функционала IncludeOptional в Apache2 (1 reply)

$
0
0
Приветствуем!

Уточните, пожалуйста, планируется ли к реализации или можно ли запросить
аналог на https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional

Юзкейс простой - есть панель управления сервером, которая генерирует
виртуальные хосты для пользователей вида

server {
server_name DOMAIN.TLD ;

listen IPv4_ADDR:443 ssl http2;
listen [IPv6_ADDR]:443 ssl http2;

ssl_certificate
'/var/www/httpd-cert/DOMAIN.TLD_2018-06-21-18-54-45.crt';
ssl_certificate_key
'/var/www/httpd-cert/DOMAIN.TLD_2018-06-21-18-54-45.key';

gzip on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/css image/x-ico application/pdf image/jpeg image/png
image/gif application/javascript application/x-javascript
application/x-pointplus;

disable_symlinks if_not_owner from=$root_path;
set $root_path /var/www/USER/data/www/DOMAIN.TLD;
root $root_path;

location / {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
include /etc/nginx/proxy_params;
}

location ~*
^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico)$
{
try_files $uri $uri/ @fallback;
expires 30d;
}

location @fallback {
proxy_pass http://127.0.0.1:81;
proxy_redirect http://127.0.0.1:81/ /;
include /etc/nginx/proxy_params;
}

include /etc/nginx/fastpanel2-sites/USER/DOMAIN.TLD.includes;
include /etc/nginx/fastpanel2-includes/*.conf;

error_log /var/www/USER/data/logs/DOMAIN.TLD-frontend.error.log;
access_log /var/www/USER/data/logs/DOMAIN.TLD-frontend.access.log;
}

server {
listen IPv4_ADDR:80;
listen [IPv6_ADDR]:80;
server_name DOMAIN.TLD ;
return 301 https://$host$request_uri;
}

Для некоторых хостов требуются кастомные локейшены, например include
/etc/nginx/fastpanel2-sites/USER/DOMAIN.TLD.includes;

Но эти кастомные локейшены требуются довольно редко, что приводит к тому,
что мы создаем большое количество пустых файлов.

Спасибо!
---
Respectfully, Dmitrii Kovalkov
FASTVPS technical department
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 3102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>