Files
stacks-puppet-node/api/deployment/nginx.cfg
2018-01-16 14:40:49 -08:00

43 lines
1.1 KiB
INI

uwsgi_cache_path /tmp/blockstack_uwsgi_cache levels=1:2 keys_zone=api:50m inactive=180m;
server {
listen 80 default_server;
server_name core.example.com;
return 301 https://core.example.com$request_uri;
location / {
include uwsgi_params;
uwsgi_pass localhost:3000;
}
}
server {
listen 443 default_server;
server_name core.example.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/core.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/core.example.com/privkey.pem;
location / {
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, HEAD, POST, OPTIONS";
add_header Access-Control-Max-Age "21600";
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;
}
include uwsgi_params;
uwsgi_pass localhost:3000;
expires 180m;
uwsgi_cache api; uwsgi_cache_key $uri$args;
add_header X-Cache-Status $upstream_cache_status;
uwsgi_cache_methods GET HEAD;
uwsgi_cache_valid 200 12h; uwsgi_cache_valid 404 12h;
}
}