Answer the question
In order to leave comments, you need to log in
Why did this nginx config stop working after upgrading Ubuntu from 18.04 to 20.04?
Good afternoon!
I tried to upgrade the server to Ubuntu 20.04 and was forced to roll back to backup, because. one of the sites stopped working normally, and I couldn’t figure out why on my own.
There is this config:
server {
listen 443 ssl http2;
server_name domain.tld;
root /var/www/domain.tld;
index index.php index.html;
autoindex off;
location / {
try_files $uri $uri/ /$uri.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_index index.php;
try_files $uri =404;
}
location ~ /\.ht {
deny all;
}
location ~* \.(css|js|gif|ico|jpeg|jpg|png|svg|svgz|woff|woff2|ttf|otf|eot|json)$ {
expires max;
}
location /l/ {
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
}
location /t/ {
rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
}
location /w/ {
rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
}
location /confirm/ {
rewrite ^/confirm/(.*)$ /confirm.php?i=$1 last;
}
location /unsubscribe/ {
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
}
location /subscribe/ {
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
}
ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
location / {
try_files $uri /$uri.php$is_args$args;
}
Options +FollowSymLinks
Options -Multiviews
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9-]+)$ $1.php [L]
# Link tracker
RewriteRule ^l/([a-zA-Z0-9/]+)$ l.php?i=$1 [L]
# Open tracker
RewriteRule ^t/([a-zA-Z0-9/]+)$ t.php?i=$1 [L]
# Web version
RewriteRule ^w/([a-zA-Z0-9/]+)$ w.php?i=$1 [L]
# unsubscribe
RewriteRule ^unsubscribe/(.*)$ unsubscribe.php?i=$1 [L]
# subscribe
RewriteRule ^subscribe/(.*)$ subscribe.php?i=$1 [L]
Answer the question
In order to leave comments, you need to log in
We need to check the logs.
Perhaps PHP configs in other places, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question