Guest User

nginx-nonwww.stpl

a guest
Oct 28th, 2020
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. server {
  2. listen %ip%:%web_ssl_port% ssl http2;
  3. server_name %domain_idn% %alias_idn%;
  4. root %sdocroot%;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  8. error_log /var/log/nginx/domains/%domain%.error.log error;
  9.  
  10. ssl_certificate %ssl_pem%;
  11. ssl_certificate_key %ssl_key%;
  12. ssl_stapling on;
  13. ssl_stapling_verify on;
  14.  
  15. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  16.  
  17. if ($host = "%alias_idn%") {
  18. return 301 https://%domain_idn%$request_uri;
  19. }
  20.  
  21. location / {
  22.  
  23. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  24. expires max;
  25. fastcgi_hide_header "Set-Cookie";
  26. fastcgi_hide_header "Set-Cookie";
  27. }
  28.  
  29. location ~ [^/]\.php(/|$) {
  30. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  31. if (!-f $document_root$fastcgi_script_name) {
  32. return 404;
  33. }
  34.  
  35. fastcgi_pass %backend_lsnr%;
  36. fastcgi_index index.php;
  37. include /etc/nginx/fastcgi_params;
  38. }
  39. }
  40.  
  41. location /error/ {
  42. alias %home%/%user%/web/%domain%/document_errors/;
  43. }
  44.  
  45. location ~* "/\.(htaccess|htpasswd)$" {
  46. deny all;
  47. return 404;
  48. }
  49.  
  50. location /vstats/ {
  51. alias %home%/%user%/web/%domain%/stats/;
  52. include %home%/%user%/web/%domain%/stats/auth.conf*;
  53. }
  54.  
  55. include /etc/nginx/conf.d/phpmyadmin.inc*;
  56. include /etc/nginx/conf.d/phppgadmin.inc*;
  57. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  58. }
  59.  
Add Comment
Please, Sign In to add comment