Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for uncached page #3

Open
Genaker opened this issue Aug 22, 2023 · 0 comments
Open

Fallback for uncached page #3

Genaker opened this issue Aug 22, 2023 · 0 comments

Comments

@Genaker
Copy link
Owner

Genaker commented Aug 22, 2023

server {
listen 80 default_server;

location / {
    
    if ($uri ~ "^/$") {
        rewrite / /404;
    }
    
    proxy_intercept_errors on;
    proxy_pass http://codes:80;
    
    error_page 403 404 503 = @outage;
    
    error_page 400 401 500 = @miss-php;
}

location @outage {
    rewrite ^ /200;
    proxy_pass http://codes:80;
}

location @miss-php {
    fastcgi_pass codes-php:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /var/www/html/index.php;
    fastcgi_param DOCUMENT_ROOT /var/www/html;
    internal;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant