Advertisement
Guest User

nginx conf for phpBB3.2

a guest
Feb 9th, 2017
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.58 KB | None | 0 0
  1. server {
  2.         listen xx.xx.xx.xx:80;
  3.         listen [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]:80;
  4.  
  5.  
  6.         server_name mydomainname.com www.mydomainname.com;
  7.  
  8.         root   /var/www/mydomainname.com/web/;
  9.  
  10.  
  11.  
  12.         index index.html index.htm index.php index.cgi index.pl index.xhtml;
  13.  
  14.  
  15.         location ~ \.shtml$ {
  16.             ssi on;
  17.         }
  18.  
  19.  
  20.         error_page 400 /error/400.html;
  21.         error_page 401 /error/401.html;
  22.         error_page 403 /error/403.html;
  23.         error_page 404 /error/404.html;
  24.         error_page 405 /error/405.html;
  25.         error_page 500 /error/500.html;
  26.         error_page 502 /error/502.html;
  27.         error_page 503 /error/503.html;
  28.         recursive_error_pages on;
  29.         location = /error/400.html {
  30.  
  31.             internal;
  32.         }
  33.         location = /error/401.html {
  34.  
  35.             internal;
  36.         }
  37.         location = /error/403.html {
  38.  
  39.             internal;
  40.         }
  41.         location = /error/404.html {
  42.  
  43.             internal;
  44.         }
  45.         location = /error/405.html {
  46.  
  47.             internal;
  48.         }
  49.         location = /error/500.html {
  50.  
  51.             internal;
  52.         }
  53.         location = /error/502.html {
  54.  
  55.             internal;
  56.         }
  57.         location = /error/503.html {
  58.  
  59.             internal;
  60.         }
  61.  
  62.         error_log /var/log/ispconfig/httpd/mydomainname.com/error.log;
  63.         access_log /var/log/ispconfig/httpd/mydomainname.com/access.log combined;
  64.  
  65.         location ~ /\.(?!well-known/acme-challenge/) {
  66.             deny all;
  67.             access_log off;
  68.             log_not_found off;
  69.         }
  70.  
  71.         location = /favicon.ico {
  72.             log_not_found off;
  73.             access_log off;
  74.         }
  75.  
  76.         location = /robots.txt {
  77.             allow all;
  78.             log_not_found off;
  79.             access_log off;
  80.         }
  81.  
  82.         location /stats/ {
  83.  
  84.             index index.html index.php;
  85.             auth_basic "Members Only";
  86.             auth_basic_user_file /var/www/clients/client1/web6/web/stats/.htpasswd_stats;
  87.         }
  88.  
  89.         location ^~ /awstats-icon {
  90.             alias /usr/share/awstats/icon;
  91.         }
  92.  
  93.         location ~ \.php$ {
  94.             try_files /302e261d29653b05ffb56715b8aafeb9.htm @php;
  95.         }
  96.  
  97.         location @php {
  98.                 try_files $uri =404;
  99.                 include /etc/nginx/fastcgi_params;
  100.                 fastcgi_pass unix:/var/run/hhvm/hhvm.web6.sock;
  101.                 fastcgi_index index.php;
  102.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  103.                 fastcgi_intercept_errors on;
  104.                 error_page 500 501 502 503 = @phpfallback;
  105.         }
  106.  
  107.         location @phpfallback {
  108.                 try_files $uri =404;
  109.                 include /etc/nginx/fastcgi_params;
  110.                 fastcgi_pass unix:/var/lib/php5-fpm/web6.sock;
  111.                 fastcgi_index index.php;
  112.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  113.                 fastcgi_intercept_errors on;
  114.         }
  115.  
  116.         location /cgi-bin/ {
  117.             try_files $uri =404;
  118.             include /etc/nginx/fastcgi_params;
  119.             root /var/www/clients/client1/web6;
  120.             gzip off;
  121.             fastcgi_pass  unix:/var/run/fcgiwrap.socket;
  122.             fastcgi_index index.cgi;
  123.             fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  124.             fastcgi_intercept_errors on;
  125.         }
  126.  
  127.         location / {
  128.             # phpBB uses index.htm
  129.            index index.php index.html index.htm;
  130.             try_files $uri $uri/ @rewriteapp;
  131.         }
  132.  
  133.  
  134.         location @rewriteapp {
  135.             rewrite ^(.*)$ /app.php/$1 last;
  136.         }
  137.  
  138.         # Deny access to internal phpbb files.
  139.        location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) {
  140.             deny all;
  141.             # deny was ignored before 0.8.40 for connections over IPv6.
  142.            # Use internal directive to prohibit access on older versions.
  143.            internal;
  144.         }
  145.  
  146.        
  147.         location /install/ {
  148.             # phpBB uses index.htm
  149.            try_files $uri $uri/ @rewrite_installapp;
  150.  
  151.             # Pass the php scripts to fastcgi server specified in upstream declaration.
  152.            location ~ \.php(/|$) {
  153.                 # Unmodified fastcgi_params from nginx distribution.
  154.                include fastcgi_params;
  155.                 # Necessary for php.
  156.                fastcgi_split_path_info ^(.+\.php)(/.*)$;
  157.                 fastcgi_param PATH_INFO $fastcgi_path_info;
  158.                 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  159.                 fastcgi_param DOCUMENT_ROOT $realpath_root;
  160.                 try_files $uri $uri/ /install/app.php$is_args$args;
  161.                 fastcgi_pass unix:/var/run/hhvm/hhvm.web6.sock;
  162.             }
  163.         }
  164.  
  165.         # Pass the php scripts to fastcgi server specified in upstream declaration.
  166.        location ~ \.php(/|$) {
  167.             # Unmodified fastcgi_params from nginx distribution.
  168.            include fastcgi_params;
  169.             # Necessary for php.
  170.            fastcgi_split_path_info ^(.+\.php)(/.*)$;
  171.             fastcgi_param PATH_INFO $fastcgi_path_info;
  172.             fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  173.             fastcgi_param DOCUMENT_ROOT $realpath_root;
  174.             try_files $uri $uri/ /app.php$is_args$args;
  175.             fastcgi_pass unix:/var/run/hhvm/hhvm.web6.sock;
  176.         }
  177.  
  178.         location @rewrite_installapp {
  179.             rewrite ^(.*)$ /install/app.php/$1 last;
  180.         }
  181.  
  182.  
  183.         location ~ /\.well-known/acme-challenge/ {
  184.        root /usr/local/ispconfig/interface/acme/;
  185.        index index.html index.htm;
  186.        try_files $uri =404;
  187.         }
  188.  
  189.  
  190.  
  191. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement