wordpress/rootfs/etc/templates/tmpl-app-nginx.conf
2020-03-29 01:42:21 +01:00

41 lines
906 B
Plaintext

server {
listen 80;
listen [::]:80;
server_name {{ getenv "VIRTUAL_HOST" | strings.ReplaceAll "," " " }};
set $base /var/www;
root $base/{{ getenv "WEB_ROOT" }};
# security
include nginxconfig.io/security.conf;
# logging
access_log /var/log/nginx/app-access.log;
error_log /var/log/nginx/app-error.log warn;
# index.php
index index.php;
# index.php fallback
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# handle .php
location ~ \.php$ {
fastcgi_intercept_errors on;
include nginxconfig.io/php_fastcgi.conf;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
# additional config
include nginxconfig.io/general.conf;
}