• 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;
    }
    }


  • 相关阅读:
    Spring Boot 打包插件,真是太有用了!
    java高级应用:线程池全面解析
    漫画:HTTP 协议极简教程,傻瓜都能看懂!
    Tomcat 连接数与线程池详解
    Intellij IDEA Debug 调试技巧
    Java 程序员必须掌握的 5 个注解!
    如何优雅地终止一个线程?
    springmvc实现REST中的GET、POST、PUT和DELETE
    @Resource 和 @Autowired注解的异同
    SpringMVC的各种参数绑定方式
  • 原文地址:https://www.cnblogs.com/andycja/p/16323190.html
Copyright © 2020-2023  润新知