Commit ec180fdb authored by Michael Iseard's avatar Michael Iseard
Browse files

Update nginx config

parent 511cf507
# Caching
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
server { server {
listen 80; server_name diamant.iseard.media;
server_name 127.0.0.1;
root /var/www/html; root /var/www/html;
index index.php; index index.php;
access_log /var/log/nginx/access.log; access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log; error_log /var/log/nginx/error.log;
location / { include snippets/wordpress.conf;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
} }
...@@ -96,13 +96,11 @@ gzip_types text/plain text/css application/json application/javascript applicati ...@@ -96,13 +96,11 @@ gzip_types text/plain text/css application/json application/javascript applicati
# Pass all .php files onto a php-fpm/php-fcgi server. # Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ { location ~ \.php$ {
include fastcgi.conf; try_files $uri =404;
fastcgi_intercept_errors on; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_pass wordpress:9000;
# enable cache fastcgi_index index.php;
add_header X-WP-Cache $upstream_cache_status; include fastcgi_params;
fastcgi_cache_bypass $skip_cache; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_no_cache $skip_cache; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 60m;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment