微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Backend Serverside Programing (Nginx)

upstream auth.backend { server 172.18.4.197:10000; server 172.18.4.198:10000; }
map $http_origin $cors_list { default 0; ~127.0.0.1 $http_origin; ~www.aihomeset.com $http_origin; ~aihomeset.com $http_origin; }
server { listen 80; listen 443 ssl; server_name service.aihomeset.com;
ssl_certificate /usr/local/Nginx/conf/cert/6731419__aihomeset.com.pem; ssl_certificate_key /usr/local/Nginx/conf/cert/6731419__aihomeset.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_prefer_server_ciphers on;
#error_page 500 501 502 503 504 /5xx.html; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,X-Token'; add_header Access-Control-Allow-Origin $cors_list; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Max-Age 86400;   if ($request_method = 'OPTIONS') { return 204; }
location /auth/ { proxy_pass http://auth.backend; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; #proxy_cookie_path / "/; httponly; secure; SameSite=None"; }
location / { root /home/andrew/dGuanWang; } }

        server { listen 80 default_server; listen 443 default ssl; server_name 127.0.0.1 aihomeset.com www.aihomeset.com 47.100.77.229 47.102.116.250; if ($request_uri ~* home|history|recruiment|about) { rewrite (.*) https://www.aihomeset.com; }
ssl_certificate /usr/local/Nginx/conf/cert/6731419__aihomeset.com.pem; ssl_certificate_key /usr/local/Nginx/conf/cert/6731419__aihomeset.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_prefer_server_ciphers on;
if ($request_method = 'OPTIONS') { return 204; }
location / { root /home/andrew/dGuanWang; } }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐