nginx在Siemens Low-Code部署上的应用
小艺001
2021.09.22 10:26发布于技术 - 部署与运维
4581

nginx.conf

# HTTPS server
    #
    server {
        access_log logs/nginx-access-qc.log main;
        listen       443 ssl;
        server_name  subdomain1.your-domain.com subdomain2.your-domain.com;

        ssl_certificate      your_cert.pem;
        ssl_certificate_key  your_cert.key;

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

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

        location / {
            proxy_pass http://localhost:8082;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect default;
        }
    }

your_cert.pemyour_cert.key 两个文件放在 nginx.conf同级的目录

如果你想添加响应头可以如下配置

server {
    server_name  .myserver.com
    location / {
        proxy_pass  http://mybackend;
        add_header  X-Upstream  $upstream_addr;
    }
}

Code_Dove、小晴天
点赞
收藏
手机查看
举报
1个评论
倒序看帖
仅看楼主
    小艺001
    2022.06.17 20:36 发布
    作者
    #1
    延伸阅读 https://forum.mendix.tencent-cloud.com/info/2e8f5cda173843118eb07d6fbed9236d?csr=1
    首赞
    评论
    举报