1. 程式人生 > 其它 >nginx伺服器配置傳遞給下一層的資訊的一些引數

nginx伺服器配置傳遞給下一層的資訊的一些引數

http {
    server_tokens off;    #隱藏nginx版本
    proxy_headers_hash_max_size 51200;
    proxy_headers_hash_bucket_size 6400
    server {
        listen       80;
        server_name  localhost ;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Headers' '*';
        add_header 'Access-Control-Allow-Methods' '*';

  server {
    server_tokens off;
    listen 443 ssl;
    server_name xxxx.xx.com;


    ssl_certificate /usr/local/nginx/cert/xxx.cer;
    ssl_certificate_key /usr/local/nginx/cert/xxx.key;


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


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


    charset UTF-8;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Headers' '*';
    add_header 'Access-Control-Allow-Methods' '*';

}

}