gldtn
Well-known member
I upgraded to a new instance on Linode from Ubuntu 20.04 to 22.04, and ever since I've been getting redirected to home page after inline moderation. Can someone shed a light as I can't figure it out what exactly has changed. I suspect it's something within nginx config..
Also, should I add this to fastcgi-php.conf?
Let me know if I need to check into other config files. Thanks!
My server blocks:
NGINX:
server {
listen 80;
listen [::]:80;
server_name domain.org www.domain.org;
return 301 https://$host$request_uri;
# Logs
access_log /var/log/nginx/domain.org.access.log;
error_log /var/log/nginx/domain.org.error.log;
}
server {
# SSL configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/ssl-domain.org.conf;
include snippets/ssl-params.conf;
# Root dir
root /var/www/domain.org;
index index.php index.html index.htm;
server_name domain.org www.domain.org;
location / { try_files $uri $uri/ /index.php?$uri&$args; }
# xenforo internal use
location /(internal_data|install_data|library|src) { internal; }
location ~ \.php$ {
# With php-fpm sock:
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_read_timeout 3600;
}
# Cache-Control headers
expires $expires;
# deny access to .htaccess files
location ~ /\.ht {
deny all;
}
location ~ /.well-known {
allow all;
}
}
snippets/fastcgi-php.conf:
NGINX:
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
Also, should I add this to fastcgi-php.conf?
NGINX:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Let me know if I need to check into other config files. Thanks!
Last edited: