Guest User

nginx.stpl

a guest
Oct 28th, 2020
172
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 = "%domain_idn%") {
  18. return 301 https://%alias_idn%$request_uri;
  19. }
  20.  
  21.  
  22. location / {
  23.  
  24. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  25. expires max;
  26. fastcgi_hide_header "Set-Cookie";
  27. fastcgi_hide_header "Set-Cookie";
  28. }
  29.  
  30. location ~ [^/]\.php(/|$) {
  31. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  32. if (!-f $document_root$fastcgi_script_name) {
  33. return 404;
  34. }
  35.  
  36. fastcgi_pass %backend_lsnr%;
  37. fastcgi_index index.php;
  38. include /etc/nginx/fastcgi_params;
  39. }
  40. }
  41.  
  42. location /error/ {
  43. alias %home%/%user%/web/%domain%/document_errors/;
  44. }
  45.  
  46. location ~* "/\.(htaccess|htpasswd)$" {
  47. deny all;
  48. return 404;
  49. }
  50.  
  51. location /vstats/ {
  52. alias %home%/%user%/web/%domain%/stats/;
  53. include %home%/%user%/web/%domain%/stats/auth.conf*;
  54. }
  55.  
  56. include /etc/nginx/conf.d/phpmyadmin.inc*;
  57. include /etc/nginx/conf.d/phppgadmin.inc*;
  58. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  59. }
  60.  
Add Comment
Please, Sign In to add comment