nginx https代理

    server {
        listen       443 ssl;
        server_name  baidu-test-rebuild.baidu.com;

        ssl_certificate      ca.crt;
        ssl_certificate_key  baidu.com.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        access_log /var/log/nginx/baidu-test-rebuild.aceess.log main;
        root   /usr/share/nginx-root/html;
        index  index.html index.htm;

        location / {
            proxy_pass http://baidu-test.qq.cn:8825/;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }

    }

nginx proxy代理

    server {
        listen       8815;
        server_name  loan-test.baidu.cn;
        root         /usr/share/nginx/loan;

        location /service {
            proxy_set_header Host      $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_read_timeout 200s;
            proxy_pass http://client-test.baidu.cn:8810/wasd-client/service/debtor/;

        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

nginx try_files代理

此配置学习于vue.js教程。

    server {
        listen       8814;
        server_name  wap-test.baidu.cn;
        root         /usr/share/nginx/wap;

        location /api {
            proxy_set_header Host      $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_read_timeout 200s;
            proxy_pass http://client-test.baidu.cn:8810/baidu-client/service/WAP/;
        }

        location / {
            try_files $uri $uri/ /index.html;
        }       

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }