I’m trying to run YOURLS via an NGINX server.
I’ve got it to a state where it’s working okay for /admin
and /<any short link which exists>
, but for /
or /<non-existent short URL>
I get an error 522, connection timeout.
Here’s my NGINX config (with some redactions). Does anyone know what might be wrong?
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name doma.in;
root /var/www/doma.in;
index index.php;
ssl_certificate doma.in;
ssl_certificate_key doma.in;
# Rewrites
location ~ /user.*$ {
deny all;
}
location = / {
return 301 http://elsewhere;
}
location / {
try_files $uri $uri/ /yourls-loader.php$is_args$args;
}
# PHP engine
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}