mirror of
https://github.com/bensuperpc/infrastructure.git
synced 2025-06-23 10:53:34 +02:00
Update website and disable nginx cache for now
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
include /etc/nginx/conf.d/sub/cache-uwsgi.conf;
|
||||
#include /etc/nginx/conf.d/sub/cache-uwsgi.conf;
|
||||
|
||||
upstream flask_server {
|
||||
# ip_hash;
|
||||
@ -43,6 +43,24 @@ server {
|
||||
|
||||
include /etc/nginx/conf.d/sub/options-ssl-nginx.conf;
|
||||
|
||||
#set $skip_cache 1;
|
||||
#set $skip_reason "Disabled for now";
|
||||
|
||||
#if ($request_method = POST) {
|
||||
# set $skip_cache 1;
|
||||
# set $skip_reason "POST request";
|
||||
#}
|
||||
|
||||
#if ($request_uri ~* "(/admin/|/logout|/login)") {
|
||||
# set $skip_cache 1;
|
||||
# set $skip_reason "request_uri";
|
||||
#}
|
||||
|
||||
#if ($http_cookie ~* "remember_token") {
|
||||
# set $skip_cache 1;
|
||||
# set $skip_reason "${skip_reason}-http_cookie";
|
||||
#}
|
||||
|
||||
location / { try_files $uri @flask_app; }
|
||||
|
||||
location @flask_app {
|
||||
@ -51,20 +69,25 @@ server {
|
||||
|
||||
uwsgi_buffering on;
|
||||
uwsgi_buffers 8 16k;
|
||||
|
||||
#uwsgi_cache_bypass $skip_cache;
|
||||
#uwsgi_no_cache $skip_cache;
|
||||
|
||||
uwsgi_cache UWSGI;
|
||||
uwsgi_cache_valid 200 302 10m;
|
||||
uwsgi_cache_valid 301 1h;
|
||||
uwsgi_cache_valid any 1m;
|
||||
uwsgi_cache_lock on;
|
||||
#uwsgi_cache_valid 200 302 10m;
|
||||
#uwsgi_cache_valid 301 1h;
|
||||
#uwsgi_cache_valid any 1m;
|
||||
#uwsgi_cache_lock on;
|
||||
|
||||
#uwsgi_ignore_headers Vary;
|
||||
#uwsgi_hide_header Vary;
|
||||
|
||||
uwsgi_ignore_headers Expires Cache-Control Set-Cookie Vary;
|
||||
uwsgi_hide_header Vary;
|
||||
#uwsgi_ignore_headers Expires Cache-Control Set-Cookie Vary;
|
||||
#uwsgi_hide_header Vary;
|
||||
|
||||
add_header X-cache $upstream_cache_status;
|
||||
#add_header X-cache $upstream_cache_status;
|
||||
#add_header X-cache-reason $skip_reason;
|
||||
|
||||
#uwsgi_cache UWSGI;
|
||||
}
|
||||
|
||||
# Don't write to accesslog for these files
|
||||
|
Reference in New Issue
Block a user