Clean URLs do not work on nginx

Mark

Administrator
Staff member
No experience with nginx myself, but I know others use it with visiolist.

It should be noted that apache is a requirement, nginx is not officially supported
 

leonor

Active Member
License Active
no, ot realy. I use Plesk With apache for statik files and a Nginx Proxy for dynamic files.

I dident got it to work with nginx only, because of "SEO Plugin" to create nice URL's with nginx is not realy easy.
 

Basti

Administrator
Staff member
Here is a sample ngix config i took from drupal. no experience myself with it, so you have to try it out.
Adjust your servername ( domain ) and root and you should be good to go ( pure spectulation though since its untested )

Code:
server {
        server_name domain.tld; ## your domain
        root /www/full/path/to/VL;  ## <-- Your only path reference. No ending slash
 
        location / {
                # This is cool because no php is touched for static content
                try_files $uri @rewrite;
        }
 
        location @rewrite {
                rewrite  ^/join/$ /index.php?a=join last;
                rewrite  ^/user_cpl/$ /index.php?a=user_cpl last;
                rewrite  ^/stats/(.*)/$ /index.php?a=stats&u=$1 last;
                rewrite  ^/stats/$ /index.php?a=stats last;
                rewrite  ^/details/(.*)/$ /index.php?a=details&u=$1 last;
                rewrite  ^/overall-stats/$ /index.php?a=details last;
                rewrite  ^/lost_pw/$ /index.php?a=lost_pw last;
                rewrite  ^/review/(.*)/$ /index.php?a=rate&u=$1 last;
                rewrite  ^/reviews/(.*)/$ /index.php?a=details&u=$1&all_reviews=1 last;
 
                rewrite  ^/category/(.*)/$ /index.php?cat=$1 last;
 
                rewrite  ^/rank/(.*)/(.*)/category/(.*)/$ /index.php?start=$1&method=$2&cat=$3 last;
                rewrite  ^/rank/(.*)/category/(.*)/$ /index.php?method=$1&cat=$2 last;
                rewrite  ^/rank/(.*)/(.*)/$ /index.php?start=$1&method=$2 last;
                rewrite  ^/rank/(.*)/$ /index.php?method=$1 [L]
 
                rewrite  ^/search/(.*)/(.*)/$ /index.php?a=search&start=$1&q=$2 last;
                rewrite  ^/search/(.*)/$ /index.php?a=search&q=$1 last;
                rewrite  ^/search/$ /index.php?a=search last;
 
                rewrite  ^/page/(.*)/$ /index.php?a=page&id=$1 last;
        }
 
}
 
Here is a sample ngix config i took from drupal. no experience myself with it, so you have to try it out.
Adjust your servername ( domain ) and root and you should be good to go ( pure spectulation though since its untested )

Code:
server {
        server_name domain.tld; ## your domain
        root /www/full/path/to/VL;  ## <-- Your only path reference. No ending slash
 
        location / {
                # This is cool because no php is touched for static content
                try_files $uri @rewrite;
        }
 
        location @rewrite {
                rewrite  ^/join/$ /index.php?a=join last;
                rewrite  ^/user_cpl/$ /index.php?a=user_cpl last;
                rewrite  ^/stats/(.*)/$ /index.php?a=stats&u=$1 last;
                rewrite  ^/stats/$ /index.php?a=stats last;
                rewrite  ^/details/(.*)/$ /index.php?a=details&u=$1 last;
                rewrite  ^/overall-stats/$ /index.php?a=details last;
                rewrite  ^/lost_pw/$ /index.php?a=lost_pw last;
                rewrite  ^/review/(.*)/$ /index.php?a=rate&u=$1 last;
                rewrite  ^/reviews/(.*)/$ /index.php?a=details&u=$1&all_reviews=1 last;
 
                rewrite  ^/category/(.*)/$ /index.php?cat=$1 last;
 
                rewrite  ^/rank/(.*)/(.*)/category/(.*)/$ /index.php?start=$1&method=$2&cat=$3 last;
                rewrite  ^/rank/(.*)/category/(.*)/$ /index.php?method=$1&cat=$2 last;
                rewrite  ^/rank/(.*)/(.*)/$ /index.php?start=$1&method=$2 last;
                rewrite  ^/rank/(.*)/$ /index.php?method=$1 [L]
 
                rewrite  ^/search/(.*)/(.*)/$ /index.php?a=search&start=$1&q=$2 last;
                rewrite  ^/search/(.*)/$ /index.php?a=search&q=$1 last;
                rewrite  ^/search/$ /index.php?a=search last;
 
                rewrite  ^/page/(.*)/$ /index.php?a=page&id=$1 last;
        }
 
}

I will let you know how this goes when I have time.
 
Here is a sample ngix config i took from drupal. no experience myself with it, so you have to try it out.
Adjust your servername ( domain ) and root and you should be good to go ( pure spectulation though since its untested )

Code:
server {
        server_name domain.tld; ## your domain
        root /www/full/path/to/VL;  ## <-- Your only path reference. No ending slash
 
        location / {
                # This is cool because no php is touched for static content
                try_files $uri @rewrite;
        }
 
        location @rewrite {
                rewrite  ^/join/$ /index.php?a=join last;
                rewrite  ^/user_cpl/$ /index.php?a=user_cpl last;
                rewrite  ^/stats/(.*)/$ /index.php?a=stats&u=$1 last;
                rewrite  ^/stats/$ /index.php?a=stats last;
                rewrite  ^/details/(.*)/$ /index.php?a=details&u=$1 last;
                rewrite  ^/overall-stats/$ /index.php?a=details last;
                rewrite  ^/lost_pw/$ /index.php?a=lost_pw last;
                rewrite  ^/review/(.*)/$ /index.php?a=rate&u=$1 last;
                rewrite  ^/reviews/(.*)/$ /index.php?a=details&u=$1&all_reviews=1 last;
 
                rewrite  ^/category/(.*)/$ /index.php?cat=$1 last;
 
                rewrite  ^/rank/(.*)/(.*)/category/(.*)/$ /index.php?start=$1&method=$2&cat=$3 last;
                rewrite  ^/rank/(.*)/category/(.*)/$ /index.php?method=$1&cat=$2 last;
                rewrite  ^/rank/(.*)/(.*)/$ /index.php?start=$1&method=$2 last;
                rewrite  ^/rank/(.*)/$ /index.php?method=$1 [L]
 
                rewrite  ^/search/(.*)/(.*)/$ /index.php?a=search&start=$1&q=$2 last;
                rewrite  ^/search/(.*)/$ /index.php?a=search&q=$1 last;
                rewrite  ^/search/$ /index.php?a=search last;
 
                rewrite  ^/page/(.*)/$ /index.php?a=page&id=$1 last;
        }
 
}

All is working well. You guys should put that somewhere on the main site or sticky it or something so more people are made aware of it.

Thanks again for the excellent resource.
 

Mark

Administrator
Staff member
We can't make people aware of something we don't know if it works or not, now 2 months after the request someone has finally tested this on nginx. Now we can include it in the download bundle, and update our system requirements page. :)

thank you for your feedback!
 
We can't make people aware of something we don't know if it works or not, now 2 months after the request someone has finally tested this on nginx. Now we can include it in the download bundle, and update our system requirements page. :)

thank you for your feedback!

I apologize for taking so long!

But yes everything is working well.

I look forward to seeing it in the download bundle and the system requirements page.
 

ashmetry

New Member
Not sure why I just saw this. This error is not from the application. It's from nginx indicating that the the file screenshots.php doesn't exist or the rewrite of that path doesn't exist. Has nothing to do with license. I only see screenshots.php in sources/admin/ folder but not in the root folder. Can you shed some light on how that path translate or gets rewritten?

Also is there a way to generate screenshots without using your server? I'd rather not pay to renew at the time. I'm ok with the version I have for now. Thanks
 

Mark

Administrator
Staff member
note: nginx is not officially supported

there is no rewrite in play, its a direct path to screenshots.php which is found in the root folder. if you don't have it, its because you removed it or failed to upload it.

You can generate screenshots using any method you like, but we don't support any other method than the one we built so you would need to roll your own service or write your own code too hook into another service.
 
Top