phpbb.tpl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #=========================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. # https://hestiacp.com/docs/server-administration/web-templates.html #
  5. #=========================================================================#
  6. server {
  7. listen %ip%:%web_port%;
  8. server_name %domain_idn% %alias_idn%;
  9. root %docroot%;
  10. index index.php index.html index.htm;
  11. access_log /var/log/nginx/domains/%domain%.log combined;
  12. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  13. error_log /var/log/nginx/domains/%domain%.error.log error;
  14. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  15. location = /favicon.ico {
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location = /robots.txt {
  20. allow all;
  21. log_not_found off;
  22. access_log off;
  23. }
  24. location ~ /\.(?!well-known\/) {
  25. deny all;
  26. return 404;
  27. }
  28. # Based on: https://github.com/phpbb/phpbb/blob/master/phpBB/docs/nginx.sample.conf
  29. location / {
  30. try_files $uri $uri/ @rewriteapp;
  31. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  32. fastcgi_hide_header "Set-Cookie";
  33. }
  34. # Pass the php scripts to FastCGI server specified in upstream declaration.
  35. location ~ \.php(/|$) {
  36. include /etc/nginx/fastcgi_params;
  37. fastcgi_index index.php;
  38. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  39. fastcgi_param PATH_INFO $fastcgi_path_info;
  40. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  41. fastcgi_pass %backend_lsnr%;
  42. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  43. try_files $uri $uri/ /app.php$is_args$args;
  44. }
  45. # Deny access to internal phpbb files.
  46. location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) {
  47. deny all;
  48. return 404;
  49. }
  50. }
  51. location @rewriteapp {
  52. rewrite ^(.*)$ /app.php/$1 last;
  53. }
  54. # Correctly pass scripts for installer
  55. location /install/ {
  56. try_files $uri $uri/ @rewrite_installapp =404;
  57. # Pass the php scripts to fastcgi server specified in upstream declaration.
  58. location ~ \.php(/|$) {
  59. include /etc/nginx/fastcgi_params;
  60. fastcgi_index index.php;
  61. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  62. fastcgi_param PATH_INFO $fastcgi_path_info;
  63. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  64. fastcgi_pass %backend_lsnr%;
  65. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  66. try_files $uri $uri/ /install/app.php$is_args$args =404;
  67. }
  68. }
  69. location @rewrite_installapp {
  70. rewrite ^(.*)$ /install/app.php/$1 last;
  71. }
  72. location /error/ {
  73. alias %home%/%user%/web/%domain%/document_errors/;
  74. }
  75. location /vstats/ {
  76. alias %home%/%user%/web/%domain%/stats/;
  77. include %home%/%user%/web/%domain%/stats/auth.conf*;
  78. }
  79. include /etc/nginx/conf.d/phpmyadmin.inc*;
  80. include /etc/nginx/conf.d/phppgadmin.inc*;
  81. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  82. }