|
|
@ -20,16 +20,6 @@ server { |
|
|
|
client_body_buffer_size 10M; |
|
|
|
client_body_buffer_size 10M; |
|
|
|
client_max_body_size 10M; |
|
|
|
client_max_body_size 10M; |
|
|
|
|
|
|
|
|
|
|
|
set $skip_cache 0; |
|
|
|
|
|
|
|
if ($request_method = POST) { |
|
|
|
|
|
|
|
set $skip_cache 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($http_cookie ~* "session") { |
|
|
|
|
|
|
|
set $skip_cache 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) { |
|
|
|
location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) { |
|
|
|
limit_req zone=loginlimit; |
|
|
|
limit_req zone=loginlimit; |
|
|
|
|
|
|
|
|
|
|
@ -50,12 +40,13 @@ server { |
|
|
|
location / { |
|
|
|
location / { |
|
|
|
proxy_cache mycache; |
|
|
|
proxy_cache mycache; |
|
|
|
add_header X-Cache-Status $upstream_cache_status; |
|
|
|
add_header X-Cache-Status $upstream_cache_status; |
|
|
|
proxy_ignore_headers Cache-Control Set-Cookie; |
|
|
|
proxy_ignore_headers Cache-Control Set-Cookie Expires; |
|
|
|
#proxy_ignore_headers Cache-Control; |
|
|
|
#proxy_ignore_headers Cache-Control; |
|
|
|
|
|
|
|
|
|
|
|
# logged in sessions and other reasons to bypass the cache |
|
|
|
# logged in sessions and PUT bypass the cache |
|
|
|
proxy_no_cache $skip_cache; |
|
|
|
proxy_cache_methods GET HEAD; |
|
|
|
proxy_cache_bypass $skip_cache; |
|
|
|
proxy_no_cache $cookie_session; |
|
|
|
|
|
|
|
proxy_cache_bypass $cookie_session; |
|
|
|
|
|
|
|
|
|
|
|
proxy_cache_valid any 1m; |
|
|
|
proxy_cache_valid any 1m; |
|
|
|
|
|
|
|
|
|
|
@ -67,12 +58,12 @@ server { |
|
|
|
|
|
|
|
|
|
|
|
location /images/ { |
|
|
|
location /images/ { |
|
|
|
alias /bookwyrm/app/images/; |
|
|
|
alias /bookwyrm/app/images/; |
|
|
|
access_log off; |
|
|
|
#access_log off; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
location /static/ { |
|
|
|
location /static/ { |
|
|
|
alias /bookwyrm/app/static/; |
|
|
|
alias /bookwyrm/app/static/; |
|
|
|
access_log off; |
|
|
|
#access_log off; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
include /etc/nginx/includes/ssl.conf; |
|
|
|
include /etc/nginx/includes/ssl.conf; |
|
|
|