openresty / openresty/srcache-nginx-module

Forward to named route or rewrite?

Open
#36 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
486
Forks
101
Avg merge
1h 28m
Merged PRs (30d)
2

Description

Hello,

How can I forward requests that did not match any cached entry to a named route?

I have something like:

location / {
    try_files $uri $uri/ @backend;
}

location @backend {
    rewrite / /index.php;
}

location ~ \.php$ {
    # catch 404s
    if (!-e $request_filename) { rewrite / /index.php last; }

    expires off;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

Should I place srcache_fetch and srcache_store in location / or @backend? Are there any issues if the fallback is try_files or rewrite?

Thank you in advance!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository file or test; start with the shown location /, @backend, and PHP locations and trace how srcache_fetch and srcache_store interact with try_files and rewrite. Done means documenting a clear recommendation for directive placement and fallback behavior, supported by a reproducible configuration test.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx
Domain
backend, performance
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.