首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何镜像使用443 nginx的其他端口6040?

问如何镜像使用443 nginx的其他端口6040?
EN

Ask Ubuntu用户
提问于 2018-02-28 00:35:41
回答 1查看 258关注 0票数 0

我试着探索如何使用nginx在443上回复,但是使用端口6040上的应用程序,我需要nginx回答,就像6040应用程序Tforc443 ssl,有人知道怎么做吗?

雷加

EN

回答 1

Ask Ubuntu用户

发布于 2018-02-28 11:24:06

我假设您在端口6040上处理http请求的应用程序与您的nginx服务器运行在同一台机器上。如果您的应用程序在端口6040上列出了https请求,请参阅nginx https上游。

Create是一种在公共ip上监听端口443并充当6040端口上内部应用程序的代理的服务器。

/etc/nginx/sites-available/www.example.com.vhost

代码语言:javascript
复制
server {
    # Listen on port 443 for both IPv4 and IPv6 and turn on http2 support.
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name www.example.com;

    ssl on;
    # Paths to certificates assuming you're using let's encrypt / certbot
    ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
    # There's much more directives you should fine tune for https, but that's another task.

    location / {
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_pass              http://localhost:6040;
        proxy_read_timeout      90;
        proxy_redirect          http://localhost:6040 https://www.example.com;
    }
}
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1010457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档