shlinkio / shlink

The definitive self-hosted URL shortener
https://shlink.io
MIT License
3.29k stars 262 forks source link

File not found when trying to go to a shortened link #1654

Closed uddernica closed 1 year ago

uddernica commented 1 year ago

How Shlink is set-up

Summary

location / { try_files $uri $uri/ /index.php$is_args$args; }

In the root folder there is no file index.php and that's why I have no shortcut links, when I try to follow a shortcut link writes "File not found.

uddernica commented 1 year ago

Problem solved! I am using the Hestia control panel and chose the Web Template NGINX LARAVEL this solved the problem.

`server { listen 1.0.0.1:443 ssl http2; server_name doma.in ; root /home/traffic/web/doma.in/public_html/public; index index.php index.html index.htm;

ssl_certificate      /home/traffic/conf/web/doma.in/ssl/doma.in.pem;
ssl_certificate_key  /home/traffic/conf/web/doma.in/ssl/doma.in.key;
ssl_stapling on;
ssl_stapling_verify on;

include /home/traffic/conf/web/doma.in/nginx.hsts.conf*;

location = /favicon.ico {
    log_not_found off;
    access_log off;
}

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

location ~ /\.(?!well-known\/) {
    deny all;
    return 404;
}

location / {
    try_files $uri $uri/ /index.php?$args;
    location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
        expires 30d;
        fastcgi_hide_header "Set-Cookie";
    }

    location ~ [^/]\.php(/|$) {
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        try_files $uri =404;
        fastcgi_pass unix:/run/php/php8.1-fpm-doma.in.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
        include /home/traffic/conf/web/doma.in/nginx.fastcgi_cache.conf*;
    }
}

location /error/ {
    alias   /home/traffic/web/doma.in/document_errors/;
}

location /vstats/ {
    alias   /home/traffic/web/doma.in/stats/;
    include /home/traffic/web/doma.in/stats/auth.conf*;
}

proxy_hide_header Upgrade;

include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /home/traffic/conf/web/doma.in/nginx.ssl.conf_*;

} `