How to exclude a directory in nginx?

Hello.

When cached site cached admin /wp-admin
How can you make an exception in nginx.conf?
July 2nd 19 at 13:36
1 answer
July 2nd 19 at 13:38
location /wp-admin {
 add_header Cache-Control no-cache;
 expires -1;
 }
something does not work - delia73 commented on July 2nd 19 at 13:41
user apache;
worker_processes 4;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
 worker_connections 1024;
}


http {
 include /etc/nginx/mime.types;
 default_type application/octet-stream;

 "log_format" main '$remote_addr - $remote_user [$time_local] "$request" '
 '$status $body_bytes_sent "$http_referer" '
 '"$http_user_agent" "$http_x_forwarded_for"';

 access_log /var/log/nginx/access.log main;

 sendfile on;
 #tcp_nopush on;

 keepalive_timeout 65;

 #gzip on;

 include /etc/nginx/conf.d/*.conf;
 include /etc/nginx/vhosts/*/*.conf;
server {
 server_name localhost;
 "disable_symlinks" if_not_owner;
 include /etc/nginx/vhosts-includes/*.conf;
 location @fallback {
 error_log /dev/null crit;
 proxy_pass <a href="http://127.0.0.1:8080;">http://127.0.0.1:8080;</a>
 "proxy_redirect" <a href="http://127.0.0.1:8080">http://127.0.0.1:8080</a> /;
 proxy_set_header Host $Host;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 access_log off ;
}
 listen 80;
}
 client_max_body_size 128m;
}
- delia73 commented on July 2nd 19 at 13:44
this is the code config - delia73 commented on July 2nd 19 at 13:47
well, porridge.

nginx.conf:
user apache;
worker_processes 4;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

"log_format" main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/vhosts/*.conf;

client_max_body_size 128m;
}

/etc/nginx/vhosts/myserver.conf;
server {
listen 80;
server_name localhost;
"disable_symlinks" if_not_owner;

location @fallback {
error_log /dev/null crit;
proxy_pass http://127.0.0.1:8080;
"proxy_redirect" 127.0.0.1:8080 /;
proxy_set_header Host $Host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off ;
}
/*
location /wp-admin {
add_header Cache-Control no-cache;
expires -1;
}
*/
}

And I understand you still Apache is on port 8080. so what see. - Jeanne_Konopelski5 commented on July 2nd 19 at 13:50

Find more questions by tags Hosting