From 66e1519e2382fe7bc3637786b82d2e66475101f2 Mon Sep 17 00:00:00 2001 From: Zak Henry Date: Wed, 13 Jan 2016 22:57:16 +1100 Subject: [PATCH] Fixed prod vhost files expires headers to be in the block they are required. Updated vagrantfile to allow latest version of docker and docker-compose --- Vagrantfile | 4 ++-- vhosts/nginx/production/spira-app.conf | 17 +++-------------- vhosts/nginx/production/spira-forum.conf | 9 +++------ 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 71046797..4a27ae94 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -46,8 +46,8 @@ Vagrant.configure(2) do |config| # provision apt update config.vm.provision :shell, inline: "apt-get update" # provision with docker - config.vm.provision :docker, version: "1.6.2" - config.vm.provision :docker_compose, compose_version: "1.3.1" + config.vm.provision :docker + config.vm.provision :docker_compose, project_name: "spira" # Provision the box with boostrap file config.vm.provision :shell, path: "vagrant/bootstrap.sh" diff --git a/vhosts/nginx/production/spira-app.conf b/vhosts/nginx/production/spira-app.conf index 4c19da89..63f88568 100644 --- a/vhosts/nginx/production/spira-app.conf +++ b/vhosts/nginx/production/spira-app.conf @@ -9,16 +9,13 @@ server { access_log %DATA_ROOT%/logs/access-app.log; error_log %DATA_ROOT%/logs/error-app.log warn; - # allow the source files to be read by the browser for sourcemapping - location %DATA_ROOT%/app/src { - root /; - try_files $uri $uri/ =404; - } - location / { root %DATA_ROOT%/app/build; index index.html; try_files $uri $uri/ /index.html =404; + expires max; + add_header Pragma public; + add_header Cache-Control "public"; } location /api/ { @@ -27,7 +24,6 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; port_in_redirect off; - #proxy_redirect http://127.0.0.1:8080 /api; proxy_connect_timeout 300; } @@ -41,13 +37,6 @@ server { proxy_connect_timeout 300; } - location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { - expires max; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /\.ht { deny all; } diff --git a/vhosts/nginx/production/spira-forum.conf b/vhosts/nginx/production/spira-forum.conf index cff4cfef..23191edb 100644 --- a/vhosts/nginx/production/spira-forum.conf +++ b/vhosts/nginx/production/spira-forum.conf @@ -12,6 +12,9 @@ server { location / { try_files $uri $uri/ @forum; + expires max; + add_header Pragma public; + add_header Cache-Control "public"; } location @forum { @@ -24,12 +27,6 @@ server { fastcgi_param SCRIPT_FILENAME $request_filename; } - location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { - expires max; - add_header Pragma public; - add_header Cache-Control "public"; - } - location ~ /\.ht { deny all; }