init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
map $host $flavour {
|
||||
default 'butter';
|
||||
a.website.com 'chocochip';
|
||||
b.website.com 'peanutbutter';
|
||||
}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/nginx/ssl/cert.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/key.pem;
|
||||
server_name a.website.com b.website.com sub.a.website.com;
|
||||
|
||||
root /srv/www;
|
||||
|
||||
try_files $uri $uri.html /index.html =200;
|
||||
|
||||
add_header 'access-control-allow-origin' '$http_origin';
|
||||
add_header 'access-control-allow-credentials' 'true';
|
||||
|
||||
sub_filter '%COOKIE%' '$cookie_flavour';
|
||||
|
||||
location /flavourtest {
|
||||
return 200 '$host and $flavour\n';
|
||||
}
|
||||
location /set {
|
||||
try_files $uri $uri.html /index.html =200;
|
||||
add_header set-cookie 'flavour=$flavour; max-age=3600;';
|
||||
}
|
||||
location /clear {
|
||||
try_files $uri $uri.html /index.html =200;
|
||||
add_header set-cookie 'flavour=$flavour; max-age=0';
|
||||
}
|
||||
error_page 497 https://$host:$request_port$request_uri;
|
||||
}
|
||||
Reference in New Issue
Block a user