Answer the question
In order to leave comments, you need to log in
NGINX when adding expire error 404 why?
Colleagues good evening, I need help, I haven’t worked with NGINX for a long time, then it became necessary to configure static caching.
I have such a config, when I log in to test123.com everything works good
server {
listen 80;
listen [::]:80;
server_name test123.com www.test123.com;
return 301 https://test123.com$request_uri;
}
server {
listen 443 ssl;
server_name www.test123.com;
return 301 https://test123.com$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
root /var/www/test123.com;
index index.html;
server_name test123.com;
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
gzip_comp_level 5;
ssl on;
ssl_certificate /etc/nginx/ssl/test123.com.crt;
ssl_certificate_key /etc/nginx/ssl/test123.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://122.22.222.111/;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
location ~* ^.+\.(js|css|png|gif|svg|svgz|woff|woff2|jpg|jpeg|gif|ico)$ {
expires 1m;
add_header Cache-Control "public";
proxy_pass test123;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question