Advertisement
Guest User

SSL (HTTPS) CONFIG FILE (/home/admin/conf/web - domain.ltd.n

a guest
Jan 13th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.10 KB | None | 0 0
  1. SSL (HTTPS) CONFIG FILE (/home/admin/conf/web - domain.ltd.nginx.ssl.conf)
  2.  
  3.  
  4. # Redirect www https to non-www https
  5. server {
  6.     listen IP:443 ssl http2;
  7.     server_name www.domain.com;
  8.  
  9.     ssl         on;
  10.     ssl_certificate      /home/admin/conf/web/ssl.domain.com.pem;
  11.     ssl_certificate_key  /home/admin/conf/web/ssl.domain.com.key;
  12.  
  13.     return 301 https://domain.com$request_uri;
  14. }
  15. server {
  16.     listen      IP:443 ssl http2;
  17.     server_name domain.com www.domain.com;
  18.     root        /home/admin/web/domain.com/public_html;
  19.     index       index.php index.html index.htm;
  20.     access_log  /var/log/nginx/domains/domain.com.log combined;
  21.     access_log  /var/log/nginx/domains/domain.com.bytes bytes;
  22.     error_log   /var/log/nginx/domains/domain.com.error.log error;
  23.  
  24.     ssl         on;
  25.     ssl_certificate      /home/admin/conf/web/ssl.domain.com.pem;
  26.     ssl_certificate_key  /home/admin/conf/web/ssl.domain.com.key;
  27.  
  28.     location / {
  29.  
  30.         location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  31.             expires     max;
  32.         }
  33.  
  34.         location ~ [^/]\.php(/|$) {
  35.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  36.             if (!-f $document_root$fastcgi_script_name) {
  37.                 return  404;
  38.             }
  39.  
  40.             fastcgi_pass    127.0.0.1:9002;
  41.             fastcgi_index   index.php;
  42.             include         /etc/nginx/fastcgi_params;
  43.         }
  44.     }
  45.  
  46.     error_page  403 /error/404.html;
  47.     error_page  404 /error/404.html;
  48.     error_page  500 502 503 504 /error/50x.html;
  49.  
  50.     location /error/ {
  51.         alias   /home/admin/web/domain.com/document_errors/;
  52.     }
  53.  
  54.     location ~* "/\.(htaccess|htpasswd)$" {
  55.         deny    all;
  56.         return  404;
  57.     }
  58.  
  59.     location /vstats/ {
  60.         alias   /home/admin/web/domain.com/stats/;
  61.         include /home/admin/conf/web/domain.com.auth*;
  62.     }
  63.  
  64.     include     /etc/nginx/conf.d/phpmyadmin.inc*;
  65.     include     /etc/nginx/conf.d/phppgadmin.inc*;
  66.     include     /etc/nginx/conf.d/webmail.inc*;
  67.  
  68.     include     /home/admin/conf/web/snginx.domain.com.conf*;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement