Commit 2fe2ac7b authored by Mark Harding's avatar Mark Harding
Browse files

(feat): production nginx tweaks

parent f04f245e
......@@ -5,7 +5,8 @@ server {
index index.php index.html;
server_name _;
error_log /dev/stdout info;
error_log /dev/stdout warn;
access_log off;
if ($host = 'minds.com' ) {
rewrite ^/(.*)$ https://www.minds.com/$1 permanent;
......@@ -26,7 +27,7 @@ server {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,X-No-Cache';
rewrite ^(.+)$ /index.php last;
}
......@@ -70,6 +71,7 @@ server {
location ~ \.php$ {
add_header X-Cache $upstream_cache_status;
add_header No-Cache $no_cache;
add_header X-No-Cache $no_cache;
fastcgi_cache fastcgicache;
fastcgi_cache_bypass $no_cache;
......
......@@ -27,7 +27,7 @@ http {
keepalive_timeout 65;
#gzip on;
gzip on;
fastcgi_cache_path /tmp/nginx_cache
levels=1:2
......@@ -37,7 +37,7 @@ http {
fastcgi_cache_lock on;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_cache_valid 5m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_key "$scheme$request_method$host$request_uri$http_authorization";
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
merge_slashes on;
......
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