user www-data;
worker_processes 8;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
timer_resolution 100ms;
worker_rlimit_nofile 8192;
events {
worker_connections 2048;
use epoll;
}
http {
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
charset UTF-8;
access_log /var/log/nginx/access.log;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_types text/plain application/xml application/x-javascript text/css;
output_buffers 1 32k;
postpone_output 1460;
ignore_invalid_headers on;
client_max_body_size 512m;
server_tokens off;
client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 10m;
proxy_read_timeout 10m;
connection_pool_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:20m inactive=10m max_size=256m;
proxy_temp_path /var/cache/nginx/temp;
proxy_cache_valid any 20m;
server {
listen 80 default_server;
return 403;
}
server {
listen 80;
server_name sitename.ru www.sitename.ru;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 80;
server_name sitename2.ru www.sitename2.ru;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name sitename.ru www.sitename.ru;
ssl_certificate /etc/nginx/ssl/sitename.ru/sitename.ru.crt;
ssl_certificate_key /etc/nginx/ssl/sitename.ru/sitename.ru.key;
include /etc/nginx/templates/ssl.conf;
root /home/users/sitename/sitename.ru/www;
access_log /var/log/nginx/sitename.ru.access.log;
error_log /var/log/nginx/sitename.ru.error.log info;
error_page 404 = @fallback;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
access_log /dev/null;
error_log /dev/null crit;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 443 ssl;
server_name sitename2.ru www.sitename2.ru;
ssl_certificate /etc/nginx/ssl/sitename2.ru/sitename2.ru.crt;
ssl_certificate_key /etc/nginx/ssl/sitename2.ru/sitename2.ru.key;
include /etc/nginx/templates/ssl.conf;
root /home/users/sitename2/sitename2.ru/www;
access_log /var/log/nginx/sitename2.ru.access.log;
error_log /var/log/nginx/sitename2.ru.error.log info;
error_page 404 = @fallback;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
access_log /dev/null;
error_log /dev/null crit;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
Host: sitename2.ru
, а сертификат на sitename.ru). Нужно для каждого домена завести свой server с нужным доменным именем + default_server который будет обрабатывать всё остальное. Что-то вродеserver {
listen 80;
server_name sitename.ru www.sitename.ru;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name sitename.ru www.sitename.ru;
ssl_certificate /etc/nginx/ssl/sitename.ru/sitename.ru.crt;
ssl_certificate_key /etc/nginx/ssl/sitename.ru/sitename.ru.key;
include /etc/nginx/templates/ssl.conf;
root /home/users/sitename/sitename.ru/www;
access_log /var/log/nginx/sitename.ru.access.log;
error_log /var/log/nginx/sitename.ru.error.log info;
error_page 404 = @fallback;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
access_log /dev/null;
error_log /dev/null crit;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 443 ssl;
server_name sitename2.ru www.sitename2.ru;
ssl_certificate /etc/nginx/ssl/sitename.ru/sitename2.ru.crt;
ssl_certificate_key /etc/nginx/ssl/sitename.ru/sitename2.ru.key;
include /etc/nginx/templates/ssl.conf;
root /home/users/sitename/sitename2.ru/www;
access_log /var/log/nginx/sitename2.ru.access.log;
error_log /var/log/nginx/sitename2.ru.error.log info;
error_page 404 = @fallback;
location / {
...
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
...
}
location @fallback {
...
}
}
return 301 https://$host$request_uri;
access_log off;
вместо записи в /dev/nullSELECT ip FROM table ORDER BY INET_ATON(ip) ASC;
root@astra:~# stat /dev/dvb
File: '/dev/dvb'
Size: 440 Blocks: 0 IO Block: 4096 directory
Device: 5h/5d Inode: 8590 Links: 22
Access: (0600/drw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-01-28 16:57:45.303589293 +0300
Modify: 2019-01-15 14:13:00.885904440 +0300
Change: 2019-01-21 10:01:10.937110736 +0300
Birth: -