Advertisement
str4n9er

Конфигурация домена

Jul 26th, 2019
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.30 KB | None | 0 0
  1. server { server_name www.<siteName>.ru;    
  2.     ssl_certificate "/var/www/httpd-cert/<siteName>/<siteName>.ru_le1.crtca";
  3.     ssl_certificate_key "/var/www/httpd-cert/<siteName>/<siteName>.ru_le1.key";
  4.     ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
  5.     ssl_prefer_server_ciphers on;
  6.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  7.     ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
  8.     return 301 https://<siteName>.ru:443$request_uri;  
  9.     listen <IP>:80;
  10.     listen <IP>:443 ssl;
  11. }
  12. server {
  13.     server_name <siteName>.ru ;
  14.     charset off;
  15.     disable_symlinks if_not_owner from=$root_path;
  16.     include /etc/nginx/vhosts-includes/*.conf;
  17.     include /etc/nginx/vhosts-resources/<siteName>.ru/*.conf;
  18.     error_log /var/www/httpd-logs/<siteName>.ru.error.log notice;
  19.     ssi on;
  20.     set $root_path /var/www/<siteName>/data/www/<siteName>.ru;
  21.     root $root_path;
  22.     location / {
  23.         location ~ [^/]\.ph(p\d*|tml)$ {
  24.             try_files /does_not_exists @php;
  25.         }
  26.         location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  27.             expires max;
  28.         }
  29.     }
  30.     gzip on;
  31.     gzip_comp_level 8;
  32.     gzip_disable "msie6";
  33.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  34.     location @php {
  35.         fastcgi_index index.php;
  36.         fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@<siteName>.ru";
  37.         fastcgi_pass unix:/var/www/php-fpm/<siteName>.sock;
  38.         fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
  39.         try_files $uri = /404.php;
  40.         include fastcgi_params;
  41.     }
  42.     access_log off;
  43.     return 301 https://$host:443$request_uri;
  44.     listen <IP>:80;
  45.     error_page 404 /404.php;
  46.     location = /404.php {
  47.         root /var/www/<siteName>/data/www/<siteName>.ru;
  48.         internal;
  49.     }
  50. }
  51. server {
  52.     server_name <siteName>.ru ;
  53.     ssl_certificate "/var/www/httpd-cert/<siteName>/<siteName>.ru_le1.crtca";
  54.     ssl_certificate_key "/var/www/httpd-cert/<siteName>/<siteName>.ru_le1.key";
  55.     ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
  56.     ssl_prefer_server_ciphers on;
  57.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  58.     ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
  59.     charset off;
  60.     disable_symlinks if_not_owner from=$root_path;
  61.     include /etc/nginx/vhosts-includes/*.conf;
  62.     include /etc/nginx/vhosts-resources/<siteName>.ru/*.conf;
  63.     error_log /var/www/httpd-logs/<siteName>.ru.error.log notice;
  64.     ssi on;
  65.     set $root_path /var/www/<siteName>/data/www/<siteName>.ru;
  66.     root $root_path;
  67.     gzip on;
  68.     gzip_comp_level 8;
  69.     gzip_disable "msie6";
  70.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  71.     location / {
  72.         location ~ [^/]\.ph(p\d*|tml)$ {
  73.             try_files /does_not_exists @php;
  74.         }
  75.         location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  76.             expires max;
  77.         }
  78.     }
  79.     location @php {
  80.         fastcgi_index index.php;
  81.         fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@<siteName>.ru";
  82.         fastcgi_pass unix:/var/www/php-fpm/<siteName>.sock;
  83.         fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
  84.         try_files $uri =404;
  85.         include fastcgi_params;
  86.         fastcgi_intercept_errors on;
  87.     }
  88.     add_header Strict-Transport-Security "max-age=31536000;";
  89.     access_log off;
  90.     listen <IP>:443 ssl;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement