nginx添加一个server

Posted xgmxm

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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/;
    }
}

 

 

以上是关于nginx添加一个server的主要内容,如果未能解决你的问题,请参考以下文章

缺少 SQL SERVER 2014 代码片段

nginx.conf 忽略了 nginx-ingress 配置映射片段

Nginx 跨域

nginx添加一个server

在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途

5.3 Nginx 动静分离