Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da68d078b0 | |||
| 9d48ce54c1 | |||
| c120d7a164 |
17
nginx.conf
17
nginx.conf
@@ -27,12 +27,24 @@ http {
|
|||||||
rewrite ^ /index.html last;
|
rewrite ^ /index.html last;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass $arg_url;
|
# Forward query string to upstream (? if url has no query, & if it already has ?)
|
||||||
|
set $url_sep "?";
|
||||||
|
if ($arg_url ~ \?) {
|
||||||
|
set $url_sep "&";
|
||||||
|
}
|
||||||
|
proxy_pass $arg_url$url_sep$args;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $proxy_host;
|
proxy_set_header Host $proxy_host;
|
||||||
proxy_ssl_server_name on;
|
proxy_ssl_server_name on;
|
||||||
|
|
||||||
# CORS headers
|
# Strip upstream CORS so we only send our own (duplicate = browser reject)
|
||||||
|
proxy_hide_header Access-Control-Allow-Origin;
|
||||||
|
proxy_hide_header Access-Control-Allow-Methods;
|
||||||
|
proxy_hide_header Access-Control-Allow-Headers;
|
||||||
|
proxy_hide_header Access-Control-Expose-Headers;
|
||||||
|
proxy_hide_header Access-Control-Max-Age;
|
||||||
|
|
||||||
|
# CORS headers — replace with our own *
|
||||||
add_header Access-Control-Allow-Origin * always;
|
add_header Access-Control-Allow-Origin * always;
|
||||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH" always;
|
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH" always;
|
||||||
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-Cache,X-NoCache,X-Status" always;
|
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-Cache,X-NoCache,X-Status" always;
|
||||||
@@ -45,6 +57,7 @@ http {
|
|||||||
|
|
||||||
proxy_cache api_cache;
|
proxy_cache api_cache;
|
||||||
proxy_cache_valid 200 201 202 203 204 205 206 207 208 226 365d;
|
proxy_cache_valid 200 201 202 203 204 205 206 207 208 226 365d;
|
||||||
|
proxy_ignore_headers Cache-Control Expires;
|
||||||
|
|
||||||
proxy_cache_bypass $http_x_nocache;
|
proxy_cache_bypass $http_x_nocache;
|
||||||
proxy_no_cache $http_x_nocache;
|
proxy_no_cache $http_x_nocache;
|
||||||
|
|||||||
Reference in New Issue
Block a user