Jump to content
Froxlor Forum
  • 0

overriding nginx try_files setting


OliverRahner

Question

And the next issue on my way to nginx'iness.

I want to run Seafile on one vhost. I added all the settings Seafile told me to in their manual (https://manual.seafile.com/deploy/deploy_with_nginx.html).

Didn't work at first (got 404'ed after the initial redirect), but once I commented out either the "try_files" in "location /" or in "location @php" it started working.
It seems that the =404 which is default in "location @php" is the issue.

Even after reading through the source code's "mergeVhostCustom" magic I couldn't find a way to override the default try_files statement without patching my Froxlor installation...

Any hints?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

On 1/26/2018 at 10:46 AM, d00p said:

There is an issue on github for this already...

 

On 7/12/2017 at 5:35 AM, negrusti said:

Most of WordPress static caching plugins require try_files modification on Nginx, this is a very much needed feature.

 

On 6/6/2017 at 12:04 PM, OliverRahner said:

And the next issue on my way to nginx'iness.

I want to run Seafile on one vhost. I added all the settings Seafile told me to in their manual (https://manual.seafile.com/deploy/deploy_with_nginx.html).

Didn't work at first (got 404'ed after the initial redirect), but once I commented out either the "try_files" in "location /" or in "location @php" it started working.
It seems that the =404 which is default in "location @php" is the issue.

Even after reading through the source code's "mergeVhostCustom" magic I couldn't find a way to override the default try_files statement without patching my Froxlor installation...

Any hints?

 

On 1/26/2018 at 10:46 AM, d00p said:

There is an issue on github for this already...



Please how are current FROXLOR users able to Host websites like Wordpress and other websites since this issue is yet to be resolved.

Please I really need your response as most of my websites are either Pure PHP or WordPress and I use NGINX as web server and PHP-FPM on a CentOS 7 machine

 

Link to comment
Share on other sites

On 1.2.2018 at 7:55 PM, kingsley ezenwa said:

Please how are current FROXLOR users able to Host websites like Wordpress and other websites since this issue is yet to be resolved.

Don't know what you mean. Just installed a test wordpress on a server running nginx....no problem...again, like in other threads: READ CAREFULLY:

On 1.2.2018 at 7:55 PM, kingsley ezenwa said:

Most of WordPress static caching plugins require try_files modification on Nginx, this is a very much needed feature.

This doesn't mean wordpress itself does not work...

Link to comment
Share on other sites

My current quick-and-very-dirty workaround looks like this:

froxlor/scripts/jobs/cron_tasks.inc.http.30.nginx.php

if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
    $webroot_text .= "\t" . 'index    index.php index.html index.htm;' . "\n";
    if (!preg_match("/^##NO_TRY_FILES$/m", $domain['specialsettings']))
    {
        $webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
    } else {
        // NO_TRY_FILES statement found, don't put try_files into config
    }
} else {
    $webroot_text .= "\t" . 'index    index.html index.htm;' . "\n";
}

If I now put the statement "##NO_TRY_FILES" on a line by itself into the vhost special settings, no "try_files" will be generated in "location /".

Link to comment
Share on other sites

I also require this Feature.

Most websites including WordPress require a config as simple as 

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

 

But this conflicts with what's Provided by Froxlor and NGINX would give error unable to start due to multiple  Location/      directives.
Once I digged into Froxlor, commented it out and mine worked But that equally affected my Froxlor installation forcing me to revert it back.

Please it's a much needed feature.
Thanks for the Good Work

Link to comment
Share on other sites

On 7/12/2017 at 5:37 AM, d00p said:

Open Up a bugreport/Feature request on github then please.

I also require this Feature.

Most websites including WordPress require a config as simple as 

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

 

But this conflicts with what's Provided by Froxlor and NGINX would give error unable to start due to multiple  Location/      directives.
Once I digged into Froxlor, commented it out and mine worked But that equally affected my Froxlor installation  (giving either WHITE Screen or 500 internal Error) forcing me to revert it back.

Please it's a much needed feature.
Thanks for the Good Work

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...