# Sample nginx configuration file for phpBB. # Tested with: # - nginx 0.8.35 # - nginx 1.17.7 (mainline) # # Filename: /etc/nginx/sites-available/example.com.conf # # Replace example.com with your own domain name. # Sample FastCGI server configuration. # Filename: /etc/nginx/conf.d/php.conf # # upstream php { # server unix:/run/php-fpm/php-fpm.sock; # } # Remove www domain prefix. server { listen 80; # IPv6 listen [::]:80; # Remove www server_name www.example.com; return 301 $scheme://example.com$request_uri; } # Board configuration. server { listen 80; # IPv6 listen [::]:80; server_name example.com; root /path/to/phpbb; # phpBB uses index.htm index index.php index.html index.htm; # Loggers error_log /var/log/nginx/example.com.error.log warn; access_log /var/log/nginx/example.com.access.log; location / { try_files $uri $uri/ @rewriteapp; # Pass the php scripts to FastCGI server specified in upstream declaration. location ~ \.php(/|$) { include fastcgi.conf; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; try_files $uri $uri/ /app.php$is_args$args; fastcgi_pass php; } # Deny access to internal phpbb files. location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?