Update website and disable nginx cache for now

This commit is contained in:
Bensuperpc 2022-12-01 14:42:01 +01:00
parent dea573b4fd
commit 3a5a73f6a6
No known key found for this signature in database
GPG Key ID: D00C6B1021747EED
2 changed files with 33 additions and 10 deletions

@ -1 +1 @@
Subproject commit a83b09c8143dc681be72385e7948288c6e005941 Subproject commit 8e0e433bdf1969282d89b3bb9f14a722d1bc4acf

View File

@ -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 { upstream flask_server {
# ip_hash; # ip_hash;
@ -43,6 +43,24 @@ server {
include /etc/nginx/conf.d/sub/options-ssl-nginx.conf; 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 / { try_files $uri @flask_app; }
location @flask_app { location @flask_app {
@ -51,20 +69,25 @@ server {
uwsgi_buffering on; uwsgi_buffering on;
uwsgi_buffers 8 16k; 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 200 302 10m; #uwsgi_cache_valid 301 1h;
uwsgi_cache_valid 301 1h; #uwsgi_cache_valid any 1m;
uwsgi_cache_valid any 1m; #uwsgi_cache_lock on;
uwsgi_cache_lock on;
#uwsgi_ignore_headers Vary; #uwsgi_ignore_headers Vary;
#uwsgi_hide_header Vary; #uwsgi_hide_header Vary;
uwsgi_ignore_headers Expires Cache-Control Set-Cookie Vary; #uwsgi_ignore_headers Expires Cache-Control Set-Cookie Vary;
uwsgi_hide_header 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 # Don't write to accesslog for these files