Помогите пожалуйста с конфигурацией NGINX для phpBB
Исходные данные:
Linux Rocky 9, PHP Version 8.4.2, MySQL 8.0.36, phpBB 3.3.14, NGINX 1.26.2
PHP-FPM 8.4.2 (собрана вместе с PHP), Sphinx 3.7.1
Вот пока что какой у меня /etc/nginx/nginx.conf
Код: Выделить всё
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /run/nginx.pid;
# Load dynamic modules. Now it's 0 of them )
#include /usr/lib64/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $document_root$fastcgi_script_name > "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
fastcgi_pass_request_body on;
client_body_in_file_only off;
client_max_body_size 128m;
gzip off;
gzip_static off;
gzip_vary off;
server {
listen [::]:80 default_server;
listen 80 default_server;
server_name _;
return 307 https://$host$request_uri;
}
server {
server_name forum.our_domain;
root /our_domain/forum;
include /etc/nginx/forum.conf;
}
server {
server_name test.our_domain;
root /our_domain/test;
include /etc/nginx/forum.conf;
}
}
выглядит так:
Код: Выделить всё
listen 443 ssl;
http2 on;
index index.php;
# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=63072000" always;
access_log /var/log/nginx/forum.access.log main;
ssl_certificate /etc/letsencrypt/live/privet.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/privet.com/privkey.pem; # managed by Certbot
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location / {
try_files $uri $uri/ @rewriteapp =404;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
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;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#try_files $uri $uri/ /app.php$is_args$args;
#try_files $uri $uri/ =404;
fastcgi_intercept_errors on;
#include fastcgi_params;
}
# Deny access to internal phpbb files.
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) {
deny all;
internal;
}
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
Буду весьма признателен за вашу экспертизу и советы
