nginx在mendix部署上的应用
engalar
2021.09.22 10:26发布于技术 - 部署与运维
2230

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、小晴天
点赞
收藏
手机查看
举报
0个评论
倒序看帖
仅看楼主

暂无数据