Giter Club home page Giter Club logo

Comments (4)

jessuppi avatar jessuppi commented on May 27, 2024 1

I had thought this wasn't working correctly, but seems that it is working fine actually:

location ~* \.php$ {
    include /etc/nginx/fastcgi.conf;
    try_files $uri $uri/ /index.php?$args; ## send .php requests to WordPress if not found
...
}

Ref: https://serverfault.com/questions/901761/nginx-redirect-to-a-php-file-with-try-files-if-required-php-file-not-found

Ref: https://github.com/littlebizzy/slickstack/blob/master/modules/nginx/sites/production.txt

So I'm closing this for now.

from slickstack.

jessuppi avatar jessuppi commented on May 27, 2024 1

It's still not working consistently. I discovered it's a conflict with FastCGI Cache rules, this snippet:

## blank session and strip cookie header if cached page ##
if ($skip_cache = 0 ) {
        set $ss_session "";
        more_clear_headers "Set-Cookie*";
}

...under the location ~* \.php$ { block. Disabling FastCGI Cache on a SlickStack server fixes it immediately...

from slickstack.

jessuppi avatar jessuppi commented on May 27, 2024 1

I see GridPane skips FastCGI cache on .php files:

https://gridpane.com/kb/gridpane-default-cache-exclusions/

Thus, their similar redirect of non-existent .php files probably works more consistently:

https://gridpane.com/kb/redirects-with-non-existent-php-files/

from slickstack.

jessuppi avatar jessuppi commented on May 27, 2024

It's a conflict between the if conditions and try_files ... not very well documented. I found these:

https://stackoverflow.com/questions/39548301/if-conditions-break-try-files-in-nginx-configuration

https://stackoverflow.com/questions/50318014/try-files-directive-being-ignored-when-used-with-fastcgi

https://serverfault.com/questions/579613/nginx-config-if-and-try-files

from slickstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.