生產環境nginx設定檔(帶https安全認證)

來源:互聯網
上載者:User

標籤:rlimit   app   ext   ati   介面   events   exp   content   resource   

#user www www;worker_processes  2;error_log  logs/error.log  info;pid        /usr/local/nginx/nginx.pid;worker_rlimit_nofile 65535;events {    use epoll;    worker_connections  65535;}http {    include       mime.types;    default_type  application/octet-stream;      log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘                                   ‘$status $body_bytes_sent "$http_referer" ‘                                   ‘"$http_user_agent" "$http_x_forwarded_for"‘;    access_log  logs/access.log  main;    server_names_hash_bucket_size 128;    client_header_buffer_size 512k;    large_client_header_buffers 4 512k;    client_body_buffer_size    30m;    client_max_body_size 100m;     server_tokens off;    ignore_invalid_headers   on;    recursive_error_pages    on;    sendfile                 on;    tcp_nopush     on;    tcp_nodelay    on;    keepalive_timeout  65;    gzip  on;    gzip_min_length  1k;    gzip_http_version 1.0;    gzip_comp_level 2;    gzip_types       text/plain application/x-javascript text/css application/xml;            upstream truck {        ip_hash;        server 10.74.**.**:8080;                   }        upstream model{      server 10.74.**.**:8080;    }            upstream mvsp{      server 10.74.**.**:6006;    }        upstream fastdfs{      server 10.74.**.**:8080;    }            server {        listen 80;        server_name isafety.mintaian.com;                #永久重新導向到 https 網站        return      301 https://$server_name$request_uri;        }        #server {    #listen       80;    #server_name  isafety.mintaian.com;    #    #    #location ~* /{    #  proxy_pass http://truck;    #                    proxy_set_header        Host $host:80;    #                    proxy_set_header        X-Real-IP $remote_addr;    #                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;    #                    client_max_body_size 400m;    #                    proxy_connect_timeout 600;    #                    proxy_send_timeout 600;    #                    proxy_read_timeout 600;    #            }    #                #                #    access_log /usr/local/nginx/logs/isafety.mintaian.com.log;    #    #}        server {               listen       443;        server_name  isafety.mintaian.com;        ssl   on;        ssl_certificate       ../sslkey/1_isafety.mintaian.com_bundle.crt;        ssl_certificate_key   ../sslkey/2_isafety.mintaian.com.key;        ssl_session_timeout   5m;        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;        ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;         ssl_prefer_server_ciphers on;                #========模型介面===========#        location ~* /mintaian/datatransmission {          proxy_pass http://model;                                    }            #=======**科技頁面代理=====>start       location ~* /Ferry {          proxy_pass http://mvsp;                                                                                                }       location ~* /ThirdResource {          proxy_pass http://mvsp;                                                                                                }       location ~* /vehicleAlarmData {          proxy_pass http://mvsp;                                                                                                }                       #=======**科技頁面代理=====>end           #代理測試檔案伺服器        location ~* /group1 {            proxy_pass http://fastdfs;        }        location ~* /group2 {            proxy_pass http://fastdfs;        }            #file        location ~* /file/ {            add_header ‘Access-Control-Allow-Origin‘ ‘*‘;            add_header ‘Access-Control-Allow-Methods‘ ‘GET, POST, OPTIONS‘;            add_header ‘Access-Control-Allow-Headers‘ ‘Origin, X-Requested-With, Content-Type, Accept‘;            root /usr/local/nginx;        }                location ~* / {          proxy_pass http://truck;                            proxy_set_header        Host $host:80;                            proxy_set_header        X-Real-IP $remote_addr;                            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;                            client_max_body_size 400m;                            proxy_connect_timeout 600;                            proxy_send_timeout 600;                            proxy_read_timeout 600;                                                        proxy_set_header Upgrade $http_upgrade;                            proxy_set_header Connection "upgrade";                             proxy_set_header X-Forwarded-Proto  $scheme;                    }        access_log /usr/local/nginx/logs/isafety.mintaian.com.log;    }}

 

生產環境nginx設定檔(帶https安全認證)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.