Answer the question
In order to leave comments, you need to log in
How to implement selective caching in NGINX?
Greetings, I'm not a professional in administration, so I'm looking for help here, I hope kind people will help. A site should be opened very soon, where there will be a sharp influx of users, to ensure stability, I decided to use NGINX in caching mode (other cp offered in Vesta: default, hosting, http2). It is in this mode that when virtual users are launched, the server shows the best response results and does not crash.
But, I ran into a problem, the site is under development and is only accessible with a password, but if I enable caching, this protection is bypassed, as I understand it, all users are given the page I downloaded bypassing authorization.
I would also like to exclude the admin directory from caching by entering in the config:
location /administrator {
add_header Cache-Control no-cache;
expires -1;
}
I get an error starting NGINX Error: nginx failed to start with new config
what am I doing wrong? how to implement selective caching of directories and ask the user to enter authorization data, and not to issue a ready-made page ignoring authorization bypass? Please correct me if there are errors in the config or I'm going the wrong way, I'm ready to provide additional information about the server or other configs if any are needed, thanks!
CMS Joomla / Php 7.4.15 / CGI-FastCGI / nginx 1.18.0 2cores 4gb ram
Answer the question
In order to leave comments, you need to log in
What kind of traffic do you expect and what do you have inside?
From experience, there is a site on joomla, spinning on a regular hosting for 2k rubles a year with a daily attendance of 40k per day, caching is not even included in joomla. When increasing the load, we use native Joomla
caching, there are several options ,
read
here joomla.center/baza-joomla/skorost-zagruzki-joomla/nastrojka-keshirovaniya-v-joomla configuring servers for joomla dogs ate more than Koreans.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question