Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2591

[3.3.x] Support Forum • Re: Trouble with NGINX on CloudPanel installing PHPBB

$
0
0
Alright so... after working on this over a week, I have finally figured it out. For others who are using CloudPanel and are wanting to use PHPBB, here is the correctly configured vhost for your nginx setup. Its a slightly altered phpbb nginx vhost sample. Be sure to change the URLs to your own.

Code:

# Remove www domain prefix.server {listen 80;# IPv6listen [::]:80;# Remove wwwserver_name www.example;return 301 $scheme://example.com$request_uri;}# Board configuration.server {listen 80;# IPv6listen [::]:80;listen 443 ssl http2;    listen [::]:443 ssl http2;{{ssl_certificate_key}}    {{ssl_certificate}}server_name example.com;root /home/example/htdocs/example.com;# phpBB uses index.htmindex index.php index.html index.htm;# Loggers  {{nginx_access_log}}  {{nginx_error_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 127.0.0.1:{{php_fpm_port}};}# Deny access to internal phpbb files.location ~ /(config|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor|vendor-ext) {deny all;# deny was ignored before 0.8.40 for connections over IPv6.# Use internal directive to prohibit access on older versions.internal;}}location @rewriteapp {rewrite ^(.*)$ /app.php/$1 last;}# Correctly pass scripts for installerlocation /install/ {try_files $uri $uri/ @rewrite_installapp =404;# 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/ /install/app.php$is_args$args =404;fastcgi_pass 127.0.0.1:{{php_fpm_port}};}}location @rewrite_installapp {rewrite ^(.*)$ /install/app.php/$1 last;}# Deny access to version control system directories.location ~ /\.svn|/\.git {deny all;internal;}# Deny access to apache configuration files.location ~ /\.htaccess|/\.htpasswd|/\.htgroups {deny all;internal;}}

Statistics: Posted by LordOfSpoon — Mon Jul 21, 2025 5:39 am



Viewing all articles
Browse latest Browse all 2591

Trending Articles