3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
# configuration file /etc/nginx/conf.d/site1.com.conf:
server {
listen 80;
server_name site1.com;
return 301 https://$server_name$request_uri;
rewrite ^ https://site1$request_uri? permanent;
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
# proxy_pass http://backend;
try_files $uri $uri/ /index.php?$query_string;
}
}
server {
listen 443 ssl;
server_name site1;
ssl_certificate /etc/nginx/ssl/nginx_ssl_2022.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
location / {
proxy_pass http://backend;
}
}
############
### Cache configuration
# proxy_cache reverse_cache;
# proxy_cache_valid 3s;
# proxy_no_cache $cookie_PHPSESSID;
# proxy_cache_bypass $cookie_PHPSESSID;
# proxy_cache_key "$scheme$host$request_uri";
# add_header X-Cache $upstream_cache_status;
# configuration file /etc/nginx/conf.d/site2.com.conf:
server {
listen 80;
server_name site2.com;
return 301 https://$server_name$request_uri;
rewrite ^ https://site2.com$request_uri? permanent;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
# proxy_pass http://backend;
try_files $uri $uri/ /index.php?$query_string;
}
}
server {
listen 443 ssl;
server_name site2.com;
ssl_certificate /etc/nginx/ssl/nginx_ssl_2022.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
access_log /var/log/nginx/ssl-site2.com-access.log;
error_log /var/log/nginx/ssl-site2.com-error.log debug;
location / {
proxy_pass http://backend;
}
}
### Cache configuration
# proxy_cache reverse_cache;
# proxy_cache_valid 3s;
# proxy_no_cache $cookie_PHPSESSID;
# proxy_cache_bypass $cookie_PHPSESSID;
# proxy_cache_key "$scheme$host$request_uri";
# add_header X-Cache $upstream_cache_status;
# configuration file /etc/nginx/sites-enabled/load_balancer-01.conf:
upstream backend {
ip_hash;
server 192.168.0.11;
# server 192.168.0.12;
}
server {
listen 80;
server_name 10.10.10.110;
location / {
# proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://backend;
}
}
а теперь давайте вернемся в моему самому первому “вангованию”
Обсуждают сегодня