wordpress-nginx-main/sites-available/nginx-varnish-apache.conf
hhftechnologies dd82b3e56c update
2024-09-28 17:48:20 +05:30

38 lines
886 B
Text

iserver {
listen 80;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
listen 80;
server_name example.com;
index index.php;
# Replace the path with the actual path to WordPress core files
root /home/username/sites/example.com/public;
access_log /var/log/nginx/example.com-access.log combined buffer=64k flush=5m if=$loggable;
error_log /var/log/nginx/example.com-error.log;
include "globals/assets.conf";
include "globals/restrictions.conf";
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~ \.php$ {
proxy_pass http://apache;
include proxy_params;
}
location @backend {
proxy_pass http://varnish;
include proxy_params;
}
location / {
try_files $uri @backend;
}
}