Skip to content

Instantly share code, notes, and snippets.

View uicosp's full-sized avatar
🎯
Focusing

uicosp uicosp

🎯
Focusing
View GitHub Profile
@uicosp
uicosp / nginx-https-config
Created August 15, 2018 17:43
Nginx HTTPS 配置
server {
listen 80;
server_name example.org;
access_log off;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.org;
@uicosp
uicosp / tengine-cors-config
Last active August 15, 2018 17:41
Tengine 版跨域配置
# 跨域规范请查阅
# https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
set $cors 'FALSE';
if ($http_origin ~ '^https?://(localhost|.*\.domain\.com)$') {
set $cors 'TRUE';
}
if ($request_method = 'OPTIONS') {
set $flag "${cors}+PREFLIGHT";
@uicosp
uicosp / nginx-cors-config
Last active August 15, 2018 17:34
最正确的 nginx 跨域配置
# 跨域规范请查阅
# https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
set $cors 'FALSE';
if ($http_origin ~ '^https?://(localhost|.*\.domain\.com)$') {
set $cors 'TRUE';
}
if ($request_method = 'OPTIONS') {
set $flag "${cors}+PREFLIGHT";