nginx添加一个server

  • nginx添加一个server
server {
        listen 80;
        server_name  dev.pccb.com;
        index        index.html index.htm;
#        rewrite ^/(.*)$ https://$server_name/$1 permanent;
        location / {
        proxy_set_header   Host    $host;
        proxy_set_header   X-Forwarded-Proto  $scheme;
        proxy_set_header   X-Real-IP   $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://192.168.55.209:8081/;
    }
}
server {
    listen       443 ssl;
    server_name  dev.pccb.com;
    ssl_certificate      /opt/nginx/conf/cert/git.prosysoft.cn/214220528520123.pem;
    ssl_certificate_key  /opt/nginx/conf/cert/git.prosysoft.cn/214220528520123.key;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    location / {
        proxy_set_header   Host    $host;
        proxy_set_header   X-Forwarded-Proto  $scheme;
        proxy_set_header   X-Real-IP   $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://192.168.55.209:8081/;
    }
}

 

 

转载于:https://www.cnblogs.com/hanxiaohui/p/8487713.html

你可能感兴趣的:(nginx添加一个server)