我试着探索如何使用nginx在443上回复,但是使用端口6040上的应用程序,我需要nginx回答,就像6040应用程序Tforc443 ssl,有人知道怎么做吗?
雷加
发布于 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
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;
}
}https://askubuntu.com/questions/1010457
复制相似问题